Solved

java.lang Out of memory

Posted on 2006-11-07
3
250 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

13 Experts available now in Live!

Get 1:1 Help Now