Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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.

 
get schwifty. tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!