Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] How can I get the exact time of each class that JVM spent on loading them?

HI Tom,

Very helpful.  The case we met is the same as the one that you post the link.  After reordering the invocation in the start method, now I have solved my problem.


On Tue, May 6, 2008 at 4:14 AM, Thomas Watson <tjwatson@xxxxxxxxxx> wrote:

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



Inactive hide details for "Yu Bady" ---05/04/2008 10:00:31 AM---We have an Eclipse-based application running on MAC OS X. Durin"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


From:

"Yu Bady" <bady.yu@xxxxxxxxx>

To:

equinox-dev@xxxxxxxxxxx

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@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


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


GIF image

GIF image


Back to the top