rmartinus
rmartinus

Reputation: 690

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 text alt text alt text alt text alt text

Added the free command screenshot: alt text

Upvotes: 5

Views: 3436

Answers (3)

Stephen C
Stephen C

Reputation: 718768

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.)

Upvotes: 4

Neil Coffey
Neil Coffey

Reputation: 21795

What does "free -t" display? I wonder if one of the figures is including cached file system data (which is used memory in the sense it's physically used for something, but free in the sense that it can be cleared out at any moment if necessary).

Upvotes: 1

Inv3r53
Inv3r53

Reputation: 2959

the system monitor is showing how memory is being used by the tomcat process which is 2G[max heap size yo have set is allocated].

on linux try comparing it with free -m which shows current free memory.

Upvotes: 1

Related Questions