Hi

Equinox does not have anything built in that can give you the amount of
time it takes to load a class.  But there are a couple of things I suggest
you look into.

- Does your classes have static initializers that may do a lot of work.
All static initializers of a class are run before any code is executed in a
class.  This would happen before you execute a constructor.

- Do you have lazy activated bundles?  These bundles would have the
Bundle-ActivationPolicy or Eclipse-LazyStart header.  If a lazy start
bundle has a BundleActivator class that does a lot of work then it will
cause an initial slowdown the first time a class is loaded from the bundle.

- Do you have anything in your logs that indicate a timeout occurred while
activating a bundle?  There are cases where the VM locks the classloader
natively before entering the OSGi class loaders.  This can cause deadlock
in lazy activation.  In Equinox we will detect the deadlock and will break
it after a 5 second timeout.  See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=209920 for an example.  I
only mention this because you say the creation of one object took 5 seconds
which is the same amount of time use for the timeout before we break the
deadlock.  If this is occurring you should see an exception in your log
similar to the in bug 209920.

Tom




                                                                       
  From:       "Yu Bady" <[EMAIL PROTECTED]>                            
                                                                       
  To:         equinox-dev@eclipse.org                                  
                                                                       
  Date:       05/04/2008 10:00 AM                                      
                                                                       
  Subject:    [equinox-dev] How can I get the exact time of each class that JVM 
spent on loading them?
                                                                       





We have an Eclipse-based application running on MAC OS X. During the
startup process, we found that the creation of one object took 5 seconds.
After print the time-stamp at the entrance of  the class's constructor, we
knew that most of the time were spent before the invoke of the constructor.
So we deduce that the loading/verifying/resolving of the class consumed
most of the time.

On the other hand, this class has complex dependency trees. It may not be
practicable for us to look at each related classes one by one. So we hope
to use some tools to find the exact time that are spent to
load/verify/resolve related classes when we create the object.

With -verbose:class, we can only know the order that each related classes
are loaded. There is no any time-stamps associating with them.

Any suggestions or comments will be highly appreciated.
_______________________________________________
equinox-dev mailing list
equinox-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

_______________________________________________
equinox-dev mailing list
equinox-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/equinox-dev

Reply via email to