Free Support Forum -

"OutOfMemoryError: Java heap space" while using Aspoce Cells in Java


We are facing “OutOfMemoryError: Java heap space” issue while processing data using Aspose cells utility. My primary requirement is to fetch the data from database and save it to 4 different worksheets of Excel workbook (.xlsx). But when I fetch the data from database and start putting it into the sheets it fails while processing 2nd or 3rd or 4th sheet. Sometimes it may also get fails while saving the workbook (it all depends on number of data).
I also have tried LightCells API. But my doubt is, it will get used when we will save the Workbook, but i got the error before saving it or while processing it.

Note: We don’t have formulas, charts or graphs. We just have all the columns as text.

Workbook data details:
Sheet1 25 columns 180838 rows
Sheet2 15 columns 288462 rows
Sheet3 105 columns 128576 rows
Sheet4 54 columns 183009 rows

Developement environment:
OS : Windows 7
Language : Java (jdk1.5)
Application Server : JBoss
Database Server : MSSQL 2008
Memory arguments : -Xms1024m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=128m

Tejal Patil


Well, since you are putting huge list of data into worksheets, so it will surely require lots of memory. Please make sure you have sufficient amount of memory allocated for the big process.

I think you LightCells API might work for your needs, see the document on how to use it for your reference:

We also recommend you to kindly try our latest version e.g Aspose.Cells for Java v7.4.1 (latest version - you may download it from Downloads module).

If you still find the issue, kindly create a sample console (runnable) JAVA program using only Aspose.Cells API, provide us the source JAVA files. Please use some dummy data to input into cells and do not involve back end database as it may also eat more memory which might result in your issue. We will check it soon.

Thank you.