Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Unable to run CPU trace profiling on a remote application

Moderators: Vladimir Kondratyev, Anton Katilin

Unable to run CPU trace profiling on a remote application

Postby rkanoong » Thu Feb 18, 2010 5:56 pm

I have a .Net application running on a production 32-bit Window server. I need to attach YourKit profiler from my local machine to profile this application. As per the instructions on "Profiling remote Applications", I have registered the profiler agent ynpagent.dll and setup the environment variables COR_PROFILER and COR_ENABLE_PROFILING on remote production machine. Then, application is started on remote production machine and I run the profiler UI on my local machine and connect to remote application. The connection works ok and CPU profiling with sampling options works fine.

However, I need to do CPU tracing profiling to check for time spent in each method, invocation counts, hotspots etc. On starting CPU Tracing with appropriate filters set, I get error "CPU tracing has not been enabled for this application at startup".

What is required for enabling CPU Tracing for remote process? Can it be done without starting the process from Profiler UI ?

Thanks.
rkanoong
 
Posts: 3
Joined: Thu Feb 18, 2010 5:39 pm

Re: Unable to run CPU trace profiling on a remote application

Postby Anton Katilin » Thu Feb 18, 2010 7:01 pm

Hello,

At the remote machine, please set the following REG_DWORD registry key to 0:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\YNP_TRACING_DISABLED

If profiled application is running, it should be restarted to apply the change.

Best regards,
Anton
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am

Re: Unable to run CPU trace profiling on a remote application

Postby rkanoong » Thu Feb 18, 2010 8:50 pm

Thanks Anton. It worked.

How can I enable Allocation recording for remote application.

Thanks.
rkanoong
 
Posts: 3
Joined: Thu Feb 18, 2010 5:39 pm

Re: Unable to run CPU trace profiling on a remote application

Postby Vladimir Kondratyev » Fri Feb 19, 2010 12:18 pm

Please read this thread viewtopic.php?f=5&t=3253
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Re: Unable to run CPU trace profiling on a remote application

Postby rkanoong » Fri Feb 19, 2010 3:19 pm

One more question:
I have the profiler agent ynpagent.dll registered, environment variables COR_PROFILER and COR_ENABLE_PROFILING set and registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\YNP_TRACING_DISABLED to 0 on remote production machine. Allocation recording is not enabled.

At this time, I am not connecting to the process from Profiler GUI. However, the performance of the application on production machine seems to have slowed since the above was done. Does the profiler agent impact the performance even when not connected to Profiler GUI? And, does it impact performance when attached to GUI in sampling mode? As per YourKit documentation, performance is impacted primarily in Tracing mode. Please clarify.

Thanks.
rkanoong
 
Posts: 3
Joined: Thu Feb 18, 2010 5:39 pm

Re: Unable to run CPU trace profiling on a remote application

Postby Anton Katilin » Fri Feb 19, 2010 3:52 pm

Hello,

Simply enabling tracing in a CLR process impacts performance, even when tracing is not running (when it is running, impact is bigger). This is a limitation of .NET framework which cannot turn its internal events for tracing support on demand. And this is why tracing is NOT enabled by default.

Sampling does not affect performance when it is not active. When it is active, its overhead is smaller that tracing's overhead.

So, do not enable tracing unless you really need it.

To reduce impact of tracing if you anyway need it, you can enable profiling in particular application(s) only, setting COR_PROFILER and COR_ENABLE_PROFILING via environment variables of the process instead of the registry.

Best regards,
Anton
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am


Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 2 guests