wood burning stoves 2.0*
The moose likes JSP and the fly likes handling OutOfMemoryError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "handling OutOfMemoryError" Watch "handling OutOfMemoryError" New topic
Author

handling OutOfMemoryError

gendhe ranjith kumar
Greenhorn

Joined: Mar 28, 2011
Posts: 20
hi

i am using jsp to generate excel

if the excel file is large iam getting OutOfMemoryError.

i do not want to increase the heap size.

i want to dump data in excel until i get OutOfMemoryError.

means

if i get error after dumping 30,000 rows. then i want save the file with 29,990 rows.

because of

heap size of jdks are different.


please give solution to this.




Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

gendhe ranjith kumar wrote:hi

i am using jsp to generate excel

if the excel file is large iam getting OutOfMemoryError.

i do not want to increase the heap size.

i want to dump data in excel until i get OutOfMemoryError.

means

if i get error after dumping 30,000 rows. then i want save the file with 29,990 rows.

because of

heap size of jdks are different.


please give solution to this.






one does not handle out of memory error. Not if one wants stable application. Determine how many rows are safe and save that, dividing large files into smaller files.

read what java docs say about it: http://download.oracle.com/javase/6/docs/api/java/lang/Error.html

An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors are abnormal conditions. The ThreadDeath error, though a "normal" condition, is also a subclass of Error because most applications should not try to catch it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: handling OutOfMemoryError
 
Similar Threads
Analyse large heap dump file
Read a .xls,.xlsx file format using XSSF
Increasing JVM Heap size at run time
generate large XLS file using java
POI OutOfMemoryError