• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Out of memory exception in tomcat

 
sreenivas kup
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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???
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
lesley evensen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic