You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Halstead, Chris" <Ch...@delta.com> on 2003/04/21 20:45:23 UTC

JDK 1.4 vs. JDK 1.3

In reaction to the significant difference I've seen in Tomcat CPU utilization between JDK 1.3 and JDK 1.4 I did some quick CPU profiling of the two using -Xrunhprof:cpu=samples.

Profiling was done on a 2-way E450 using Solaris 8, JDK 1.3.1_02 and JDK 1.4.1_02.  I ran a JMeter test with two threads of 1000 iterations each against the default Tomcat welcome page (HTTP keepalives enabled with maxKeepAliveRequests=2000).  The only variable between the two runs was the version of JDK.


Here are top five CPU consumers under JDK 1.3:

CPU SAMPLES BEGIN (total = 414) Mon Apr 21 14:42:31 2003
rank   self  accum   count trace method
   1 15.70% 15.70%      65    36 java.io.UnixFileSystem.getBooleanAttributes0
   2 11.59% 27.29%      48    32 java.io.UnixFileSystem.getBooleanAttributes0
   3  5.07% 32.37%      21     1 java.util.zip.ZipFile.open
   4  2.66% 35.02%      11    41 java.lang.String.substring
   5  2.42% 37.44%      10    59 java.lang.ClassLoader.defineClass0


Now, here are the top five under JDk 1.4:

CPU SAMPLES BEGIN (total = 4784) Mon Apr 21 14:33:23 2003
rank   self  accum   count trace method
   1 60.31% 60.31%    2885   444 java.net.PlainSocketImpl.socketAccept
   2 27.15% 87.46%    1299   504 java.net.SocketInputStream.socketRead0
   3  0.88% 88.34%      42    21 java.lang.String.substring
   4  0.82% 89.15%      39    36 java.io.UnixFileSystem.getBooleanAttributes0
   5  0.38% 89.53%      18   583 java.io.ObjectOutputStream.defaultWriteFields


It's easy to see why JDK 1.4 has such high CPU use...notice the almost 3000 socketAccept() calls that aren't present in the JDK 1.3 report.

Anyone have a reasonable explanation?

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org