wood burning stoves 2.0*
The moose likes Tomcat and the fly likes frequent OutOfMemoryErrors, any known cure? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "frequent OutOfMemoryErrors, any known cure?" Watch "frequent OutOfMemoryErrors, any known cure?" New topic
Author

frequent OutOfMemoryErrors, any known cure?

Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
One of our customers running Tomcat 4.1 with a small web application we sold them (about a dozen servlets and a similar number of simple JSPs, no large memory demands (few KB per session) sometimes gets OutOfMemoryErrors.
Lately it's been getting worse, sometimes the problem starts after only a dozen or so requests.

All JSPs had been compiled weeks ago (and the server since restarted) so it's unlikely to be the known Jasper leak.


42
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There was a bug in j2sdk1.4.1 causing the StringBuffer class to leak memory.
If they're using that, have them go up to 1.4.2.

Have you tried increasing the amount allocated to the server with the Xms and Xmx options?

Of course if it is a memory leak, increasing it will only postpone the problem.
[ February 11, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Arto Pastinen
Ranch Hand

Joined: Dec 13, 2002
Posts: 79
Hi!

Does your customer install/reinstall lot applications to tomcat?

One situation which i know is application, which uses hibernate and cglib. Every time you reinstall application to tomcat, it "leaks" little memory, because hibernate/cglib generates new classes runtime, and this "leaks" little memory, because there is no way to remove class instance from JVM.
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
Sounds like memory leaks to me. Maybe you should check for cyclical references in your code
Is your server-side processing CPU-intensive?. Maybe GC is not kicking in
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
turned out to be an ArrayList blowing up under certain conditions.
Changed a loop termination condition which did the trick.

One problem solved but we're still suffering from the JSP compiler leak on our own machines for another application...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Jeroen Wenting:

One problem solved but we're still suffering from the JSP compiler leak on our own machines for another application...


Not possible to upgrade to 5x?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: frequent OutOfMemoryErrors, any known cure?
 
Similar Threads
tomcat in real environment
main
How to ?
Question about error pages and JSTL
WA #1.....word association