Memory (JAVA)

Dear Laurence,


When we are generating large reports like the one i discussed in a
previous conversation we are running out of memory when calling the
write method of the Workbook class. A workbook that when stored takes
up 80 MB on disk, the write method temporarily allocates 300 MB of byte arrays.
Could the write method be optimized in some way to allocate less
temporary byte arrays?


Thanks

Ulf

Dear Ulf,

Do you mean when you call write method, an extra 300MB of byte arrays are allocated?

We will check and optimize in some way. But is it possible to split your file to smaller size? It will make all work more stable.

Hi Ulf,

Please try this attached version.

Dear Laurence,



Thanks for the update. I haven’t verified the memory consumption yet. I
will test it later today. However, when using the new
Cell.setValue(Object method) i received the following exception:



Exception in thread “main” java.lang.StackOverflowError

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

at com.aspose.excel.Cell.setValue(Unknown Source)

etc.



Thanks,

Ulf

Hi Ulf,

What's the type of this object? Thank you.

Dear Laurence,



The object I tried to set was a new Double(0).



Regards,

Ulf

Hi Ulf,

We did find a problem about this method. Please try this attached fix.

But your problem doesn't seem to be related to this bug. It seems that you don't use the latest jar file.

This attached file is our test code.

Dear Laurence,



With the latest version I no longer receive the exception. Thanks a lot!



Best regards,

Ulf