Solved

java.lang Out of memory

Posted on 2006-11-07
3
248 Views
Last Modified: 2008-01-09
I have a jsp based web application running on Tomcat 5.0.28 on a windows 2000 server.  There are about 140 users of the web application.

At least once a day a java.lang Out of memory message is displayed instead of the jsps being served.  The only way we have found to rectify this problem is to restart the tomcat service.

Any ideas on how to stop this happening ?
0
Comment
Question by:Sean_Devlin
3 Comments
 
LVL 5

Accepted Solution

by:
rowdy_h earned 250 total points
ID: 17893125
Possibly you have a memory leak that is eating up the memory. If so you probably want to find a profiling tool that will help you. I can't advise on what to try as we use the Tivoli tools with Websphere.

Another possibility is that the JVM heapsize is too small for your application. We had this initially with a new webapp at work. I don't know tomcat myself so maybe someone else can tell you to find out what heapsize it's using. The default for websphere that we use was 256Mb or 512Mb (I can't remember which). As we have a server with several gig of memory we could easily increase this. If you know where the settings are in tomcat then try experimenting with increasing the values. However, remember you need to leave memory free for the operating system and anything else you're running on the box. Try watching the box's memory use while the application is running to work out how much free the box has that the app could use.

If tomcat allows you to set command line arguments for the JVM then the relevant switches are -Xms (for minimum heap size) and -Xmx (for maximum heap size).

If the above don't help and your application is caching data from a database you may need to adjust the amount being cached down to leave memory free. It will slow down your app, but hopefully it'll stop it falling over.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now