File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Out Of memory issue on tomcat. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Out Of memory issue on tomcat." Watch "Out Of memory issue on tomcat." New topic
Author

Out Of memory issue on tomcat.

Shama Nagabhushan
Greenhorn

Joined: Jan 31, 2013
Posts: 3
Hi All,

We are using tomcat6.0 as our web application server. But recently we have been observing a lot of Out Of memory issues on the server dut ot which heap dumps are created.!! I have read articles on this forum which could help me in avoiding OOM and heap dump file creation and have implemented it also!!!

I have tuned JVM also.

But the issue is somewhat different in our case. Usually when heap dumps are created due to OOM, we restart the server to recover JVM crash.
Hence We have added the restart script in crontab such that the server is restarted twice a day. But in our case, 15 mins after the server is restarted, I see heapdumps accumulated on /home directory and OOM error on catalina.log file!!!

Heapdumps eat up file system space and we get frequent big brother alerts!

Could anyone help us on this issue?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

I think you're going to have to sit down and read what's in those heapdumps. Tomcat's memory footprint is fairly small as Java applications go. Most of the memory usage comes from applications deployed under Tomcat.

In particular, there are no known cases where Tomcat servers are running wild on memory usage, so that would indicate that you probably have a badly-behaving web application.


Customer surveys are for companies who didn't pay proper attention to begin with.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
I always suggest using the Management app to keep an eye on memory and request Thread usage.

Bill
Shama Nagabhushan
Greenhorn

Joined: Jan 31, 2013
Posts: 3
Hi ALl,

But my question is, why does the heap dumps gets created or there is OOM when the tomcat server is restarted. We have installed Sun IdM application on tomcat.

Could anyone tell me if the heap dump is created due to the application issue or due to tomcat issue?

Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
You appear to be hoping that someone will say "oh yeah tomcat does that all the time for no reason" - sorry, nobody is going to say that.

Given the long record that Tomcat has for correct execution I would bet a lot of money that your application is doing something wrong, just like Tim said.

Have you actually used the Management app like I suggested? How about the memory dumps, any progress there?

Bill

Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2402
    
  28

Worrying about heapdumps causing your system to go out of disk space is like worrying about the bathwater being too hot because your basement is on fire. Put the damn fire out first! Fix the OOM first, and the problem of too many heapdumps accumulating on the filesystem will fix itself.

Shama Nagabhushan
Greenhorn

Joined: Jan 31, 2013
Posts: 3
Jayesh,

I'm new to all these stuffs(being frank, a novice) working on application support project. And have very less knowledge about tomcat and what happens at the server side when we pur application here!
Could you please suggest me a site where I can find information on what happens when a tomcat server is restarted, how it loads the application. What all processes are stopped and invoked, how memory allocation for application is decided in tomcat etc etc which would help in better understanding of the issue.

Thanks,
Shama
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

Tomcat uses standard java memory management. But, like I said, it doesn't use much memory and it has no known issues with Tomcat itself having memory problems.

In the absence of information to the contrary, we can only assume that the web applications themselves contain major memory-management defects and need to be debugged and repaired. Tomcat cannot recover from the sins of others.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Out Of memory issue on tomcat.