wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Out of memory exception in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Out of memory exception in tomcat" Watch "Out of memory exception in tomcat" New topic
Author

Out of memory exception in tomcat

sreenivas kup
Greenhorn

Joined: Sep 10, 2004
Posts: 7
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

Joined: Jul 04, 2003
Posts: 1312
How many size of memory (RAM) in your computer ?


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
sreenivas kup
Greenhorn

Joined: Sep 10, 2004
Posts: 7
1GB, and my application server is also running on the same machine with
a heap of 700MB
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
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

Joined: Nov 02, 2001
Posts: 14
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?


<A HREF="mailto:zorgalina@minspring.com" rel="nofollow">zorgalina@minspring.com</A>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Out of memory exception in tomcat