Profiler must be started before profiled application

Questions about YourKit Java Profiler
Post Reply
Morten Buhr
Posts: 8
Joined: Tue Sep 14, 2004 2:47 pm

Profiler must be started before profiled application

Post by Morten Buhr »

If I do not start the profiler before the application I wish to profile, the resulting profile data is not reliable. I often see CPU usages of seveal hundred thousands of seconds even if I have only profiled for 10 seconds using method tracing.

It also seems that the CPU usage when profiling is substantially higher when profiler is not started before the profiled application.

Best Regards
/Morten
Morten Buhr
Posts: 8
Joined: Tue Sep 14, 2004 2:47 pm

additional info

Post by Morten Buhr »

I forgot to state that I am connecting remotely to the application to profile - however on the same computer, under WindowsXP and JDK-SE 1.4.2_03

/Morten
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: Profiler must be started before profiled application

Post by Vladimir Kondratyev »

Morten Buhr wrote:If I do not start the profiler before the application I wish to profile, the resulting profile data is not reliable.
yjpagent has additional parameters to enable profiling just from JVM start.
Please take a look at -Xrunyjpageht:help to lear more about profiler options.
Morten Buhr wrote: I often see CPU usages of seveal hundred thousands of seconds even if I have only profiled for 10 seconds using method tracing.
All profiling results are in milliseconds
Morten Buhr wrote:It also seems that the CPU usage when profiling is substantially higher when profiler is not started before the profiled application.
Profilier's overhead depends on the method you are using to profile your application. Sampling has almost no impact on performace but it's less accurate.
Morten Buhr
Posts: 8
Joined: Tue Sep 14, 2004 2:47 pm

Re: Profiler must be started before profiled application

Post by Morten Buhr »

Morten Buhr wrote:If I do not start the profiler before the application I wish to profile, the resulting profile data is not reliable.
Vladimir Kondratyev wrote:yjpagent has additional parameters to enable profiling just from JVM start.
Please take a look at -Xrunyjpageht:help to lear more about profiler options.
I know, but I do not want to start profiling until my application is fully up and running
Morten Buhr wrote: I often see CPU usages of seveal hundred thousands of seconds even if I have only profiled for 10 seconds using method tracing.
Vladimir Kondratyev wrote:All profiling results are in milliseconds
My mistake - I meant several hundred thousands of milliseconds.
Morten Buhr wrote:It also seems that the CPU usage when profiling is substantially higher when profiler is not started before the profiled application.
Vladimir Kondratyev wrote:Profilier's overhead depends on the method you are using to profile your application. Sampling has almost no impact on performace but it's less accurate.
I am aware of that difference. What I was trying to point out was that the CPU profiling results seems incorrect when I start yjp (run yjp.sh) after I have started my application, but delivers correct result when yjp is started before my application. In both cases I do not connect to the application until it is up and running. Also the CPU usage is often substatially higher when yjp is started after my application, using method tracing in both cases.
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: Profiler must be started before profiled application

Post by Vladimir Kondratyev »

Morten Buhr wrote:I know, but I do not want to start profiling until my application is fully up and running
You can try to use profiler API to precisely specify the moment when you want to start profiling. Please take a look at bundled samples (they contain examples of API usage).
Morten Buhr wrote: I often see CPU usages of seveal hundred thousands of seconds even if I have only profiled for 10 seconds using method tracing.
Please send us snapshot with such huge CPU usage. We'll try to investigate the problem.
Morten Buhr wrote:It also seems that the CPU usage when profiling is substantially higher when profiler is not started before the profiled application.
It's known problem that CPU degradation might happen after tracing. There is a bug in JVMPI. Actually we have reported in to the Sun JVMPI team and they said that this bug will not be fixed. We are going to migrate to new JVMTI API which is introduced in J2SDK 5.0, so this problem will be fixed.
Post Reply