Memory Issue on Opening File

Hi,


I am getting memory heap issue right away as i try to open the attached workbook. I am using ASPOSE cells version 7.5.0.

Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Double.parseDouble(Unknown Source)
at com.aspose.cells.b.a.o.a(Unknown Source)
at com.aspose.cells.ahg.F(Unknown Source)
at com.aspose.cells.aae.a(Unknown Source)
at com.aspose.cells.aae.a(Unknown Source)
at com.aspose.cells.aae.a(Unknown Source)
at com.aspose.cells.aae.b(Unknown Source)
at com.aspose.cells.aae.a(Unknown Source)
at com.aspose.cells.zz.b(Unknown Source)
at com.aspose.cells.zz.a(Unknown Source)
at com.aspose.cells.zz.k(Unknown Source)
at com.aspose.cells.zz.a(Unknown Source)
at com.aspose.cells.zz.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at com.intralinks.odfprocessingTest.ODSWorkBook.saveAsContentOnlyFiles

Please help me resolve this issue.

Thanks,
Azeem

Hi,


Well, since your file has half a million records in the sheet, it demands more memory and resources to load the file by Aspose.Cells. Even Ms Excel will take some time to load into it. Please make sure that you have sufficient memory assigned/allotted to JVM to process it. Kindly make sure that you have provided and extended the JVM memory appropriately to process.

Following is the command line you may try to use on command prompt to extend the JVM memory accordingly, so your file could be opened fine by Aspose.Cells:

E.g

java -Xms1024m -Xmx1024m MyTestProgram

Thank you.

I agree, the file is large file, we have even more large than this, having 100s of sheets with this much data those, work fine.

I want to know what is so special wrong with this, that this even fails to open.
For avoiding too much memory for Drawing Objects, i am already loading with following way.

LoadOptions ld=new LoadOptions();
ld.setLoadDataAndFormatting(true);
Workbook workbook=new Workbook(new FileInputStream(fileEntry),ld);

MS Excel takes time, but processes the file at least. What are your recommended memory options for working with these files, I am already applying the same memory options you just mentioned.

Hi,


Do you still get the exception after applying my mentioned command line to extend the JVM RAM, you may even extend the memory more accordingly.

Anyways, I have logged a ticket with an id “CELLSJAVA-40559” for our investigation if we could enhance it more to avoid any such memory issue when reading your file. Our concerned developer will analyze the issue.

Once we have any update on it, we will let you know here.

Thank you.

Hi,

By our test on a system, the maximum memory allocated by the JVM is 380M when opening your template file. It should not give such kind of exception if you have made the value of jvm option -Xmx greater than 400m. Would you please confirm it at your end and share your finding?

By the way, on a higher configured system with sufficient RAM, we don’t have to even use the command line / jvm options as it works fine.

Thank you.

Hi,


I have specified 1024 max memory for the process. Firstly attached file uses too much time to load the workbook and when i keep on parsing the cells one by one, memory keeps on increasing for aspose.cells objects, .

I tried another workaround to reload the workbook after processing the 50, 000 cells and can manage to controle the memory footprint getting bigger. But doing so, requires reloading the workbook many times, which is itself taking too much time.

Can you please suggest what is safest approach from your side to process the large files like this.


I am using cells version 7.3.0 with JDK 1.7


Thanks,
Azeem

Hi,


Thanks for attaching the template file.

Could you try our latest version/fix: Aspose.Cells for Java v7.5.1.2
if it makes any difference.


By the way, there is no good way to load your large Excel file which contains approx. one million records in a single worksheet in the workbook, so you got to have a good configured system and you got to have sufficient amount of memory allocated to the JVM.

Thank you.