Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: After each boot, slow Java startup, then no problems




On Sep 28, 2006, at 9:30 PM, Joshua Stewart wrote:

I noticed that your output from "java -version" doesn't include "sharing" after "mixed mode". Is this an important difference?

Someone else would have to answer that. I don't know.


Here's some output from running 'time java - agentlib:hprof=cpu=times -version'

To start out with I just wanted to see if anything at the bottom looked seriously out of whack. You usually aren't going to want to include the entire output of profiling in a mailing list email. When you get beyond simple things like 'java -version' the output can get really big. (mb's)



lola:~ jstewart$ time java -agentlib:hprof=cpu=times -version java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112) Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode) Dumping CPU usage by timing methods ... done.

real    0m45.576s
user    0m0.205s
sys     0m0.120s

...

CPU TIME (ms) BEGIN (total = 400) Thu Sep 28 21:26:01 2006
rank self accum count trace method
1 10.25% 10.25% 1 300052 java.lang.ClassLoader.loadClassInternal
2 10.25% 20.50% 1 300037 java.lang.ClassLoader.findLoadedClass
3 10.25% 30.75% 1 300049 java.lang.ClassLoader.loadClass
4 10.25% 41.00% 1 300050 sun.misc.Launcher $AppClassLoader.loadClass
5 10.25% 51.25% 1 300051 java.lang.ClassLoader.loadClass
6 10.00% 61.25% 1 300036 java.lang.ClassLoader.checkName
7 10.00% 71.25% 2 300034 java.lang.String.indexOf
8 3.00% 74.25% 3 300018 java.lang.Thread.init
9 3.00% 77.25% 3 300019 java.lang.Thread.<init>
10 2.25% 79.50% 1 300153 sun.misc.Version.print
11 2.25% 81.75% 1 300152 sun.misc.Version.print
12 2.00% 83.75% 3 300137 java.io.PrintStream.println

...

Michael Hall wrote:



You might try profiling...

time java -agentlib:hprof=cpu=times -version

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode)
Dumping CPU usage by timing methods ... done.

real    0m1.408s
user    0m0.324s
sys     0m0.132s

and see what is using the most time at the end of the java.hprof.txt file

CPU TIME (ms) BEGIN (total = 268) Thu Sep 28 21:00:18 2006
rank   self  accum   count trace method
   1  8.96%  8.96%       1 300152 sun.misc.Version.print
   2  8.96% 17.91%       1 300151 sun.misc.Version.print
   3  7.84% 25.75%       3 300137 java.io.PrintStream.println


You'll notice for one thing that you seem to show a lot of time consuming class loading before you get to doing the actual sun.misc.Version stuff, where my profile jumps right into that. The 7 consecutive almost identical 10(.25)% chunks to start out with is also kind of strange. One idea there might be that it just took a long time to get going and profiling tried to divide that up evenly and just assigned it to different parts of class loading. So it could actually just be all lumped together as 'start up class loading'.
That still doesn't quite seem to account for your entire delay as everything before you show sun.misc.Version is still just 77.25% of the total time or
real 0m45.576s x .7725 = 35 seconds more or less.
The question would seem to be why that initial stuff is dragging so much. Do you have anything else running at the same time? Some large busy application maybe? Does "Activity Monitor" or 'tops' or whatever show high CPU or disk usage for anything else before you start?
If you do have anything going you might try shutting it down first and test again on as near to an idle machine as you can get.
Would you have really low memory for some reason? Are you on a nearly out of space disk drive? Things like this can have major impacts on performance.
It shouldn't be the java, if it is you definitely have a bug report. But first you might try to identify what else besides the java could be giving you problems. Maybe the shared thing is significant but again, someone else would have to answer that.



Mike Hall mikehall at spacestar dot net http://www.spacestar.net/users/mikehall http://sourceforge.net/projects/macnative



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: After each boot, slow Java startup, then no problems (From: Greg Guerin <email@hidden>)
 >Re: After each boot, slow Java startup, then no problems (From: Joshua Stewart <email@hidden>)
 >Re: After each boot, slow Java startup, then no problems (From: Michael Hall <email@hidden>)
 >Re: After each boot, slow Java startup, then no problems (From: Joshua Stewart <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.