Solved

java.lang Out of memory

Posted on 2006-11-07
3
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server specifications for web hosting 7 96
LAMP problem identifier tool ? 9 127
Best IDE for PHP starters 11 142
Apache error.log 19 73
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 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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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