tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Adams <bad...@ambrosiasw.com>
Subject Re: cpu 100% java
Date Wed, 02 Aug 2006 20:53:03 GMT

On Aug 2, 2006, at 4:18 PM, Christopher Schultz wrote:

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

Think the Java that is hogging the cpu is something different.
I run /Library/Tomcat/bin/startup.sh (with ram settings)
  1792 java        27.9%  0:08.83  12   255   191  47.9M+ 13.1M  35.6M 
+  469M+ (using -Xms128m -Xmx256m)

but this one is still around
1775 java        98.8%  0:56.40  21   597   243  88.3M  9.94M   
77.8M   288M (one that hogs cpu, the problem process from the start)

I do  /Library/Tomcat/bin/shutdown.sh and I only have the pid 1775  
(hog one) other java is gone now.

Two Java programs:
Ran by Appserve "java -Djava.endorsed.dirs=/Library/Tomcat/common/ 
endorsed -classpath /Library/Java/Home/lib/tools.jar:/Library/Tomcat/ 
bin/bootstrap.jar -Dcatalina.base=/Library/Tomcat/blojsom_root - 
Dcatalina.home=/Library/Tomcat -Djava.io.tmpdir=/Library/Tomcat/ 
blojsom_root/temp org.apache.catalina.startup.Bootstrap start"
(weblogs use this one, seems to be the problem one, any idea where  
the config is for this one?)

Ran by Root "/System/Library/Frameworks/JavaVM.framework/Versions/1.4/ 
Home/bin/java -Xms128m -Xmx256m -Djava.endorsed.dirs=/Library/Tomcat/ 
common/endorsed ...." so this one is using the ram change -Xms128m - 
Xmx256m other is not.



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

Ben


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message