Solved

java.lang Out of memory

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

25 Experts available now in Live!

Get 1:1 Help Now