Huge memory Allocation when using EPPlus Excel Library

前端 未结 2 852
一整个雨季
一整个雨季 2021-01-12 17:37

Context

I have been using EPPLUS as my tool to automate excel report generation, using C# as the client language of the library.

Pro

2条回答
  •  抹茶落季
    2021-01-12 18:29

    Modern Excel files, ie, Xlsx files are zip-compressed, and often achieve compression down to 10%. I just uncompressed a 1.6MB file I generated using a similar tool and found it extracted to 18.8 MB of data.

    You've got a 0.138 GB file that is using 1.370 GB of memory, which is almost exactly 10%. The uncompressed representation in memory is what is eating your memory.

    If you're curious, you can use a tool like 7-Zip to extract the Xlsx files, or you can rename the file to end in .zip and browse it in Windows.

提交回复
热议问题