• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

tunning JVM for better memory usage

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I add a new webapp occasionally the user will get a out of memory error when trying to access a page that has not been rendered and cached yet. If I restart tomcat it is then able to render the page. The problem seems to be in tomcat trying to render several JSPs at the same time. The servers have 2 Gigs of physical memory but I have not made any changes to the parameters passed to JVM yet so I think it's only using 1 Gig of that.
Any advise on tuning the JVM or other places to look at making changes would appreciated. I have not been able to find much information on configuring tomcat beyond the basics.
Also on a side note. There seems to be a memory leak in tomcat. Every time I restart it does not seem to let go of all the memory it was using. After being up for several months the boxes would get down to less than 500M of memory free and vmstat would show a lot of free dirty memory. Rebooting the box every now and then takes care of it but it's a hassle.
I'm running Tomcat 4.1.18 on RedHat 7.2 using Apache 1.3.26 as a front end connecting to Tomcat with mod_jk. And they are running ~18 webapps
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Will Sterling:
There seems to be a memory leak in tomcat. Every time I restart it does not seem to let go of all the memory it was using. After being up for several months the boxes would get down to less than 500M of memory free and vmstat would show a lot of free dirty memory. Rebooting the box every now and then takes care of it but it's a hassle.


More likely, there's a leak in your app(s) running in it. Don't presume you've done a better job with managing your own objects and correct API usage, than Tomcat has.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The servers have 2 Gigs of physical memory but I have not made any changes to the parameters passed to JVM yet so I think it's only using 1 Gig of that.


If you are not specifying anything, the default max memory is 64MB, alot different from 1Gig. See the tooldocs for more about tuning - there are alot of options.
Bill
 
Your mind is under my control .... your will is now mine .... read this tiny ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic