| 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: 819
|
|
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.
|
 |
 |
|
|
subject: handling OutOfMemoryError
|
|
|