aspose file tools*
The moose likes Other Open Source Projects and the fly likes Write Huge Excel file (.Xlsx) POI and Java -  java.lang.OutOfMemoryError: Java heap space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Write Huge Excel file (.Xlsx) POI and Java -  java.lang.OutOfMemoryError: Java heap space" Watch "Write Huge Excel file (.Xlsx) POI and Java -  java.lang.OutOfMemoryError: Java heap space" New topic
Author

Write Huge Excel file (.Xlsx) POI and Java - java.lang.OutOfMemoryError: Java heap space

Julio leopard banderas
Greenhorn

Joined: Dec 20, 2012
Posts: 29
Hi everyone,
I'm looking for solution to write an excel file (.Xlsx) with data from database,

For example :
----------------

Code to write Xlsx file:
--------------------------


But this code give me an ERROR :


I found a solution in http://www.coderanch.com/t/424181/open-source/Read-xls-xlsx-file-format
it work verry fine but ionly for reading huge Excel file

Thanks
Olivier Rihoux
Greenhorn

Joined: Jun 03, 2013
Posts: 8
Just USE SXSSF components that keeps only small part of your file in memory

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42278
    
  64
Unless the "55555" is an actual number (and not just for testing) you could also try bumping up the JVM memory. Its default allocation is a LOT smaller than what most desktops and servers have available in unused memory.

Using Oliver's approach will probably give you more peace of mind, though :-)


Ping & DNS - my free Android networking tools app
Meer Nasirudeen
Greenhorn

Joined: Sep 30, 2007
Posts: 4
Hello everyone... I too faced the same issue of OOM while parsing xlsx file...after two days of struggle, I finally found out the below code that was really perfect;

This code is based on sjxlsx. It reads the xlsx and stores in a HSSF sheet.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Write Huge Excel file (.Xlsx) POI and Java - java.lang.OutOfMemoryError: Java heap space