Free Support Forum - aspose.com

Creation of Excel Workbook - Merge two workbooks on disk?

Hi,

We have an Export to Excel Use case in our application. The exported excel workbook has close to 95 worksheets and around 12000 filled cells (with double values, no comments or any special objects) per worksheet. Creation of this workbook on the fly is taking enormous amount of memory. We tried using Style Objects as singletons and this has considerably reduced the memory but its still occupying close to 400 MB on the heap.

When I dump the workbook onto the disk and read it into memory again using Aspose Cells loadData API, it has a smaller memory footprint i.e. around 80 MB.

Based on the above observations, I feel that we are doing something wrong which is causing Aspose to use up 400 MB on heap. Can you please throw some light on the above problem?

Also, for workbooks having more worksheets, is there any way I can create 10 excel workbooks with 10 worksheets each and then merge them at a binary level instead of creating the complete workbook in memory. The high memory footprint on the heap is creating out of memory errors during concurrrent user access.

Thanks,
Shashi

Hi Shashi,

We will check and get back to you soon.

Thanks for being patient!

Hi Shashi,

Would you please give us your sample code to create the workbook so we can look into it whether it can be improved some. For plain double values, I tested about 95 worksheets and 12000 filled cells per sheet, that created an excel file about 20M, and the memory cost was about 180M.

I am afraid currently there is no way to create and save workbooks partly and then merge them. I think maybe you need to split the data into several workbooks and save or read them separately.

Hi Johnson,

There is some complex logic that creates these workbooks which is a part of the application. Extracting that logic and creating an application that will run standalone is not trivial and hence I did not post it. I will try to get some memory debugger reports and send it across to you for more analysis.

Regarding the merge feature, since you dont have one, is it possible to implement this feature within less time? I am asking this because our users dont want to work with 20-30 workbooks as they are related using formulas. Or can you please suggest any other workaround?

Thanks,
Shashi

Hi Shashi,

I am afraid there is no better way to process a large excel file other than load it all at once, and we can't implement this feature soon. Currently we are working on some urgent bugs, work for new features is suspended until we resolve those bugs.