[EAP 606] Weird time values

Questions about YourKit Java Profiler
Post Reply
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

[EAP 606] Weird time values

Post by pepijnve »

I'm seeing some CPU profiling results that I don't quite understand.
I see
A.a 79%
B.b 25%
So now I'm wondering where the other 54% went. I read in another post that this can be due to A.a consuming CPU time itself, however if I check the implementation of this method it simply calls a method on a different object of a different class. In fact this method call is in fact between A.a and B.b. Any idea why this is missing?
The CPU snapshot was made using method tracing btw.
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

Post by pepijnve »

Some further clarifications:
- I'm using the Invocation tree by threads view
- There are in fact quite a few method calls in between A.a and B.b. It seems unlikely that the jit is inlining all of them.
- None of these missing method calls are in the filter list
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

Sorry, but I do not understand your call tree. Please send your call tree (exported to HTML) with description of the problem to [email protected]
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

Post by pepijnve »

If I understand correctly this is due to the combination of JVMPI not supporting byte code manipulation and the dynamic byte code manipulation performed by yourkit. Or does the JVMPI also not fire method entered/exit events in case of inlined methods?
If my assumption is correct, doesn't this severly limit the accuracy of the profiler. I realize this is for performance reasons, but to me accurate results are more important than raw speed...
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

This is because we used method entry/exit events provided by JVMPI, that are not always issued.

Since everything is fine in Java 5.0's JVMTI, this is not a very big problem IMO. There are so many reasons why to migrate to Java 5.0, so I believe more and more people will do it...
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

Post by pepijnve »

While I would personally prefer to migrate to 5.0, management thinks otherwise for unknown reasons. Is this 'problem' fixed if I run using -Xint?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Yes, -Xint should solve this particular problem. But it will raise another problem - profiled application will run much slower.

If it's suitable for you, I'd suggest to profile with Java 5.0. Performance optimizations made based on profiling results collected running application with Java 5.0 will most likely be adequate for production system running Java 1.4 or 1.3, because most of bottlenecks are induced by own code of application, not by JDK it runs under.

-Xint produces correct stack traces, but times can be very different from real times (i.e. when HotSpot JVM is on). I wouldn't suggest to rely much on times produced with -Xint
pepijnve
Posts: 21
Joined: Tue May 17, 2005 1:38 pm

Post by pepijnve »

Unfortunately, the code I have to work on does not run under 5.0 because someone deemed it necessary to use com.sun classes which have changed between 1.4 and 5.0 :(
I am curious now though why some coworkers of mine are not seeing this kind of behaviour with a different java profiler?
Post Reply