Background
One might want to profile an application on a remote system or in a container using dotMemory. This can be achieved using the dotMemory Command-Line Profiler, which enables application profiling via CLI.
Answer
The profiler allows you to connect to a running process or launch a new one, depending on your needs. dotMemory can be controlled via commands sent to stdin, Profiling API or by writing commands to a file using --service-input option
Below is an example demonstrating how to profile an application using dotMemory CLI. This example shows how to install dotMemory on a target system using dotnet tool, attach to a running process and control dotMemory via stdin):
- Download dotMemory command-line profiler and put it on the target system
- Run the target application on a target system
- Attach to the target process via
dotmemory attach {process_id} --save-to={snapshot_directory_path}where-
process_id- id of the target process -
snapshot_path- snapshot storage directory
-
- Wait until the profiler starts and connects to the target process (indicated by messages
Profiler connectedandYou can control the profiling session by writing the following service messages to stdin...) - Type
##dotMemory["get-snapshot"]to collect a snapshot - Use
##dotMemory["disconnect"]to disconnect the profiler from the target application - Transfer the generated
{snapshot_name}.dmwto the development system and open it in dotMemory
Find more information about this process in Use dotMemory Command-Line Profiler.
Comments
0 comments
Please sign in to leave a comment.