• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

handling OutOfMemoryError  RSS feed

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.




 
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!