This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

frequent OutOfMemoryErrors, any known cure?

 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Arto Pastinen
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 502
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic