Fully featured low overhead profiler for Java EE and Java SE platforms.
Easy-to-use performance and memory .NET profiler for Windows, Linux and macOS.
Secure and easy profiling in cloud, containers and clustered environments.
Performance monitoring and profiling of Jenkins, Bamboo, TeamCity, Gradle, Maven, Ant and JUnit.

Attach profiler to a running application

Attach technique allows loading the profiler agent into running .NET runtime. In spite of its simplicity and convenience, attaching has several limitations in functionality, that is why it is preferred when profiler agent is loaded into .NET runtime on application startup.

Attaching from profiler UI

All detected running .NET processes are shown in the Monitor Applications list on Welcome screen. The colored circle indicates the profiler agent status. When the agent is already loaded, the circle is green. Orange circle shows that agent is not yet loaded but can be attached.

monitored applications list

Attach to the application you want to profile by clicking on its name. Attach from context menu to provide custom agent options.

attach with options menu

Attaching is possible to both local and remote applications. Local applications are shown under the node with local applications icon. Applications running on the remote machines are shown under their own nodes with remote connection icon. To add a new remote machine click add remote connection. See remote profiling from user interface to learn more.

If you do not see your application it the list, please check troubleshooting and FAQ.

Attach from command line

Run the command line tool to attach profiler agent and then connect from Welcome screen.

Attach mode limitations

Not all profiling capabilities are available in the attach mode due to .NET runtime limitations listed below. To get all capabilities, application should be started with the profiler.

  • Memory profiling is disabled for applications running in concurrent GC mode. Read this MSDN article to learn how to avoid using concurrent GC mode.
  • Some threads started before attach will not be shown. In particular, they will not be seen in the thread states view and in CPU sampling results. To make the threads appear, you may try to explicitly force garbage collection via Force GC toolbar button.
  • Object allocation profiling is disabled.
  • CPU tracing is not available in .NET Framework applications.
  • Exception profiling is not available in .NET Framework applications.
  • If you experience crashes attaching to a ReadyToRun (R2R) application, use agent option disable_all. Alternatively, disable R2R feature by setting application's environment variable DOTNET_ReadyToRun=0.
  • Applications on .NET 9 and above may crash in attach mode. To avoid this, use agent option disable_all. Alternatively, disable tiered compilation by setting application's environment variable DOTNET_TieredCompilation=0.

In .NET runtime only one profiler agent can be loaded at a time. This means that attach will fail, if another profiler agent is already loaded. To avoid a profiler conflict, please make sure, that the environment variables COR_PROFILER and CORECLR_PROFILER are not set.

YourKit uses cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content, to analyze our website traffic, and to understand where our visitors are coming from.

By browsing our website, you consent to our use of cookies and other tracking technologies in accordance with the Privacy Policy.