Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java / Tomcat memory leak in RedHat Linux?

I've got a Red Hat box with 6G memory running Tomcat and I'm trying to figure out how much memory I have left on the box. Problem is, top & jconsole is showing one figure (around 200M), and system monitor is showing a different figure (around 2G). Does anybody know what the difference is?

I'm not sure if there is a memory leak happenning here, but the highest memory consumer is a tomcat process that's taking 2.2G of memory.

Screenshots below: alt textalt textalt textalt textalt text

Added the free command screenshot: alt text

like image 372
rmartinus Avatar asked Jun 01 '10 01:06

rmartinus


People also ask

Where is memory leak in Tomcat?

Go into the heap dump settings for your server Right-click on Tomcat from the sidebar on the left-hand side then select 'Heap Dump'.


1 Answers

Clearly, top is telling you that Tomcat is only using 38% of your available memory. Your problem (if there is a problem) is with whatever is using the remaining 62% of memory.

I suspect that it is being used for disc block / file system caching. (Run the free command and I expect that you should see a high value for "cached" that roughly corresponds in size to the missing pages.)

If your system has a large number of pages in the cache, it is a GOOD THING. All those cached disc blocks will make read access to your file system nice and fast. (And if the OS needs physical pages for something more important ... like running applications ... it can quickly reclaim them from the disc cache.)

like image 109
Stephen C Avatar answered Sep 27 '22 16:09

Stephen C