Reputation: 9384
I have requirement to read *.xlsx file in java for that i am using Apache POI API.if number of row are less it's work nicely but when number of row are greater then or equals 65536. i got an exception java.lang.OutOfMemoryError: Java heap space
.please help me how i am able to solve that problem.
thanks sameek
Upvotes: 1
Views: 1298
Reputation: 48326
POI supports a low memory way to read .xlsx files in a streaming way. See http://poi.apache.org/spreadsheet/how-to.html#xssf_sax_api for details on how it works, and how to get started.
Upvotes: 1
Reputation: 2082
This can be fix by Increasing Available Memory (Java heap space)
http://hvanbelle.blogspot.com/2009/07/increase-heap-size-in-java-to-prevent.html
http://confluence.atlassian.com/display/DOC/Fix+Out+of+Memory+Errors+by+Increasing+Available+Memory
http://rifers.org/blogs/gbevin/2005/4/21/get_rid_of_outofmemoryerror
Upvotes: 1
Reputation: 24248
If it possible for you save xslx file as xml - you can use SAX which is very quick and hasn't limitation about number of rows.
Upvotes: 1