tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: cpu 100% java
Date Wed, 02 Aug 2006 20:18:43 GMT
Ben,

> How much ram do I set?
>
> Load Avg:  1.30, 1.28, 1.22     CPU usage:  51.3% user, 8.4% sys, 40.3%
> idle
> SharedLibs: num =  137, resident = 22.8M code, 3.20M data, 6.41M LinkEdit
> MemRegions: num =  7345, resident =  142M + 8.15M private, 27.4M shared
> PhysMem:  61.1M wired, 68.0M active,  173M inactive,  302M used,  209M free
> VM: 3.44G + 89.5M   18117(0) pageins, 0(0) pageouts
> 
>   PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE 
> VSIZE
>   825 java       102.4%  2:43:34  61   >>>   371  98.0M   872K  85.1M- 
> 308M
> 
> Should have 209MB Available.

Aah... when Java starts up, it will cap its own memory at a certain
size, even if the OS can give it more. You set the heap size using...

> I added this to catalina.sh:
> JAVA_OPTS="$CF_JVM_OPTIONS -Xms128m -Xmx256m"

...these parameters. That means that, no matter what, Java will not
allocate more than 256MB of heap space. The JVM may take more memory
than that ('cause the non-Java stuff such as the JIT, memory manager,
etc.) all need some memory to work with, but your heap size will not get
any bigger than 256MB.

It's tough to tell what's going on with this:

>   PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE 
> VSIZE
>   825 java       102.4%  2:43:34  61   >>>   371  98.0M   872K  85.1M- 
> 308M

RSIZE (resident size, IIRC) is 85.1M - 308M? WTF does that mean?

If the 308M is spurious, then your Java process was using 85MB which
suggests that your heap size was probably more like 64MB or somewhere in
there. Increasing it to 128/256 as you have above ought to give you some
more room to move around in.

Does this help the problem?

-chris



Mime
View raw message