• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Out of memory exception in tomcat

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am trying to export large data(6000 rows and 120 columns)
to excel but Tomcat(4.1.27) is throwing java.lang.OutOfMemory Exception.
I use a custom servlet for this purpose.
I tried to increase the heap adding the below line in the "catalina.sh"

JAVA_OPTS="Xmx500000000 Xmx128000000"

but no Success.

Could you plz help me to resolving this problem???
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How many size of memory (RAM) in your computer ?
 
sreenivas kup
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1GB, and my application server is also running on the same machine with
a heap of 700MB
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be config env in catalina.sh

JAVA_OPTS="-Xms50m -Xmx1024m"


and Restart tomcat server.

If you got same error try to config env CATALINA_OPTS as same as JAVA_OPTS


------------
Finally if you still got same error , you shoule be use CAching mechanism with Tomcat Web Server .

http://www.javaworld.com/javaworld/jw-05-2004/jw-0531-cache-p4.html

http://www.onjava.com/pub/a/onjava/2003/12/23/caching.html
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're only exporting this data and don't need it to persist in your web app, make sure you're releasing all objects in your servlet (you don't have a reference to it somewhere and GC isn't removing it)
Do you get all the data in one buffer and then export to Excel? is there an exception happening somewhere prior to successfully exporting it?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic