Heavy system memory consumption while handling multiple excel sheets

Hi,

In my code, am trying to consolidate 20+ excel files that are full of charts and data into one workbook. The average size of each excel file is 4-5 MB. However, when I lead these into my program the memory usage shoots up drastically.

eg: When I open a 4 MB excel file through my program which uses Aspose.Cells the system memory usage goes up by 25-30 MB.

Further more once I am done with the excel file and assign the object a null value, the memory taken up doesn't get released. This cumulative effect leads to a total memory consumtpion of 1.5 GB which is completely unacceptable in my case since my servers don't have that much RAM on them and thats what I need to install this program finally. I also discovered that Aspose.Cells do not have the Dispose() method built in to release memory.

Can you please help me here? Thanks

Hi,

Well, if you open/save the rich workbook (e.g having charts and other drawing objects etc.) with larger size, in some case, Aspose.Cell would need more memory i.e.., about 10 * size of the file (10 times the size of the file). This might be different case when using on ASP.NET application. Which version of the product you are using, we recommend you to use our latest versions of the product in which we made tremendous enhancements regarding memory management and performance matters, e.g v7.0.2.

The component (Aspose.Cells for .NET) does not necessarily require really to free up the resources for the processes as the component is already optimized to do so automatically. When objects are no more useful in the processes, GC would collect and release the memory occupied by the objects. For your information, Aspose.Cells for .NET is a pure .NET component (created in managed .NET code) and it relies on .NET garbage collector (GC) to allocate and free the memory for the different processes, although you may try to also use GC.Collect() or set Workbook to null in some cases for your need. Moreover, if you are using Stream objects, you need to call Close() and Flush() methods to manually release the resources for the objects when they are not used.


Thank you.