Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading 50Mb Excel File Consumes 12GB Memory! #70

Open
chaojian-zhang opened this issue Sep 20, 2022 · 0 comments
Open

Reading 50Mb Excel File Consumes 12GB Memory! #70

chaojian-zhang opened this issue Sep 20, 2022 · 0 comments

Comments

@chaojian-zhang
Copy link

chaojian-zhang commented Sep 20, 2022

To replicate:

  1. Create an excel file
  2. Populate 4000 rows by 4000 columns of values and simply fill it with any number you like, e.g. 150
  3. Save the file

The file should be around 50Mb.

Now, with a new C# .Net 6.0 console project, load the file using the library as below:

using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(new FileInfo(filepath), true))
{
    var sheet = fastExcel.Read(1);
    sheet.Read();
}

In DEBUG mode, it consumes more than 12 Gb of memory just to read 4000*4000 values! (And it took almost 2 minutes to read on Lenovo P1 Gen 2)

image

By my calculation, even assume those numbers are stored as double (8 bytes), it shouldn't take so much memory: $400040008/1024^3 = 0.1192$

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant