|Re: [equinox-dev] How can I get the exact time of each class that JVM spent on loading them?|
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.
"Yu Bady" ---05/04/2008 10:00:31 AM---We have an Eclipse-based application running on MAC OS X. During the startup process, we found that the creation of one object
"Yu Bady" <bady.yu@xxxxxxxxx>
05/04/2008 10:00 AM
[equinox-dev] How can I get the exact time of each class that JVM spent on loading them?