Ubuntu – Tomcat VIRT memory usage

javamemorytomcatUbuntu

Yesterday I posted this question: Tomcat Excessive Memory Consumption

The thread was getting too long and detailed for anyone to continue helping. So now I am asking a more specific question.

When I run top, I get this:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
13749 tomcat6   20   0  493m  82m 9972 S    0  9.0   0:07.34 java

This is a fresh install of Tomcat6 on Ubuntu 11.04 (Nattty) (64-bit).

As I understand it, VIRT is the virtual memory. Is 493m in the VIRT column a "normal" thing, or is that excessively high? Keep in mind that there are no web apps running in Tomcat right now. It's just the basic vanilla install.

How about the 82m in the RES column? What does this mean and how does it compare to VIRT? That is the amount of memory I would expect Tomcat to use.

My hosting company is using Parallels Virtuozzo Containers, and apparently the stats I am provided with on memory usage comes somewhere from there. The stats they show me are that I am using 110% of my 512MB memory limit (burstable). So in fact they are counting 400-500MB worth of memory from Tomcat.

Best Answer

I am in the same situation as you: Virtual Server hosted with Parallels Virtuozzo Containers.

I have Debian 6 and Tomcat 7 installed, running the default apps and two additional small ones. The Tomcat 7 config is slightly changed, but still very similar to the default one:

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
29910 tomcat    18   0  525m  80m 9972 S  0.0  7.9   0:13.26 java 

So it seems quite normal. I assume you already now how to limit memory usage for Tomcat using JAVA_OPTS='-Xms256m -Xmx256m' ?

I am not sure how familiar you are with Tomcat, personally I always find this FAQ useful: http://wiki.apache.org/tomcat/HowTo http://wiki.apache.org/tomcat/HowTo#Where_and_how_do_I_set_memory_related_settings_to_improve_Tomcat_performance.3F

Kind Regards, Claude

Related Topic