Profiling shows where your code spends CPU time, allocates memory, and waits. OneAgent samples your running processes and adds up the cost method by method, so you can find the code behind a slow request, a CPU spike, or growing memory usage in the processes where the problem occurs.


Use
Profiling to answer questions like these:
The app also gives you these benefits:
Before you start using
Profiling, make sure your environment meets these requirements. Some analyses have additional requirements, as noted.
Profiling installed from
Hub.When you install or first open
Profiling, your administrator grants this app access to read the following data on your behalf. The app only reads data and writes only your own saved preferences.
| Permission | Description |
|---|---|
storage:entities:read | Resolve processes, process groups, and process group instances and request profiling analysis. |
storage:profiles:read | Read profiling data for CPU hotspots, thread analysis, and memory allocation. |
storage:spans:read | Build the Method executions view from traces. |
storage:buckets:read | Required to read data from storage alongside the data scopes. |
storage:smartscape:read | List the processes that can be profiled. |
storage:metrics:read | Show CPU usage charts next to the profiles. |
storage:events:read | Mark processes whose OneAgent has profiling activated. |
storage:filter-segments:read | Let you select segments in the Explorer view. |
settings:objects:read | Recognize API frames so that the call tree can label them. |
app-settings:objects:read, app-settings:objects:write | Remember saved views and your preferences. |
state:user-app-states:read, state:user-app-states:write | Remember your table settings, such as visible columns, sorting, and pagination. |
If a part of the app is empty or reports a permission error, ask your administrator to grant you the required permissions.
Install
Profiling, get to know its main views, and find the code behind the high CPU usage in your first process. This section also explains how profiling is billed.
To install
Profiling
Hub.After installation, you can open the app from
Hub > Manage or from the Apps menu.
Profiling has two main views: Explorer and a process profiling page.
Explorer is available as a tab in the app header. This view lists your processes with profiling data and charts their CPU consumption over time. For details, see Explorer view in Dynatrace apps.
A process profiling page shows profiling data for one process group or up to 10 process groups at once.
To find the code behind high CPU use in a process
Go to
Profiling > Explorer. This view loads data for the last two hours.
Find the process you want to analyze.
By default, the list shows only processes with profiling data. To narrow the list, enter a process name or its part in Search by name located above the process list.
Optional To see the busiest processes first, select the CPU usage column header.
Select a process row. The process profiling page opens.
On the Method hotspots tab, check the Flame graph. Wide blocks use the most CPU.
On the CPU tab, drag across the CPU usage chart and select Zoom to selection to view a shorter period. The selection becomes the new timeframe.
Billing for
Profiling depends on the monitoring mode of OneAgent on your hosts.
Live Debugger is turned on and billed through Code Monitoring. Deactivating Observability for Developers turns off
Live Debugger, but profiling stays on.
Live Debugger, billed through Code Monitoring. Deactivating Observability for Developers turns off both profiling and
Live Debugger and stops Code Monitoring billing.The Explorer view is where you decide what to investigate. Use it to narrow your environment to the processes you care about, see which of them use the most CPU, and open their profiling data.

The process list has one row per process group. By default, it shows the following columns:
The header above the table shows the number of matching processes and the number of hidden columns. To show more columns, such as Kubernetes, cloud, and host properties, open the column settings. You can't hide the Process group column.
To sort the list, select a column header. Select it again to reverse the order.
Use the timeframe selector in the upper-right corner of the Explorer view. For details, see Timeframe selector.
The timeframe applies to the process list and the CPU consumption chart. The app carries the timeframe over to the process profiling page when you open a process.
Filters take you from your entire environment to the processes you own, without requiring you to know process names in advance.
The facet panel on the left of the Explorer view groups filterable properties. The following facet groups let you filter by where and how your processes run:
owner, role, or team tags.To filter the process list
The CPU consumption chart above the process list shows CPU usage over time for the processes at the top of the list. The legend identifies each line.
You can profile a single process group or combine up to 10 process groups to analyze them together.
To profile one process group
Profiling > Explorer.To profile several process groups together
Profiling > Explorer.You can profile up to 10 process groups at a time. Profiling many process groups loads more data and can take longer. If loading is slow, select fewer process groups or a shorter timeframe.
The process profiling page shows CPU, memory, and thread data for the selected process groups, so you can find the methods that consume the most resources.

The process profiling page contains:
Profiling data is limited to the most recent 24 hours of the selected timeframe. If you select a longer timeframe, only the latest 24 hours are analyzed.
The URL of the process profiling page keeps the selection, tab, view, and timeframe, so you can copy it to share what you see.
When you select several process groups, the Aggregated label and the Aggregated across n process groups note appear under the process group name. This aggregation means that the data of all selected process groups is combined. Features that require a single process group are deactivated, with an explanation provided.
The CPU tab starts with a collapsible CPU usage chart. Drag across the chart to select a time range. Next to the selection, a panel shows the range and the number of data points. Select Zoom to selection to make the range the page timeframe and reload the data.
The CPU tab has two subsections below the CPU usage chart:
Method hotspots uses profiling samples. Select a view with the toggles on the left of the toolbar.
Use the following toolbar options to refine the result:
Use these tips to find the methods to optimize first:
Method executions lists the traced methods that ran in the process, ranked by cost. It answers a question that a sampled profile can't: how many times a method ran and what one call cost. Knowing this helps you tell the difference between code that's slow per call and code that's called often.
The table contains the following columns. For the definition of a column, select (Information) next to its name.
The last row, Everything else, shows the time not attributed to the listed methods.
To investigate a method, open the actions menu of its row and select one of these options:
Totals add up across all threads and include time spent in called methods, so they can exceed the timeframe.
Use these patterns to decide what to optimize:
Method executions might be deactivated in the following cases. Select (Information) to see the reason:
The Memory tab is available for JVM-based processes. It shows memory over time, with the total allocated and survived memory in the chart title, and a legend for Memory Allocated and Survived.
Below the Memory over time chart, you can switch between these views:
Use the Frames toolbar option to show All frames or only application frames. On the flame graph, use Show to choose which allocations to display. By default, all allocations are displayed. The flame graph offers Highlight method…, the tables offer Search, and every view offers Export raw data.
Use these tips to find the code behind memory pressure:
The Threads tab is available for JVM-based processes and shows one process at a time. The Thread breakdown chart shows the thread activity over the timeframe, with the number of analyzed stack trace samples in its title.
Below the Thread breakdown chart, a table lists the thread groups with their Overall execution breakdown, Estimated CPU time, and Process count. Use Search to find a thread group.
Use these tips to find out why threads are blocked:
Sampling the methods that run in a process to show where it spends CPU time, allocates memory, and waits. OneAgent collects the data, so you don't change or instrument your code.
A set of processes that run the same workload. The Explorer view lists one row per process group, and you can profile up to 10 process groups together.
A method that accounts for a large share of the samples in a profile. In the flame graph, hotspots are the widest blocks. In the ranked list, they're the top rows.
A visualization of call stacks in which the width of each block is proportional to the time spent in that method and the methods it calls. Use it to see the cost of a whole call path at a glance.
A view that nests each method under its caller, so you can follow the cost from an entry point down to the methods that spend it.
A snapshot of the call stack of a running thread. Method hotspots are based on samples, so they show where time is spent, but not how often a method ran.
A traced call of a method. Method executions is based on distributed traces and shows how often a method ran and what each call cost, which helps you distinguish slow code from frequently called code.
Frames that belong to your own code, as opposed to libraries and the runtime. Set Frames to Application to focus on code you can change.
What a thread is doing at the time of a sample: running code (Runnable), or waiting on a lock (Lock), disk (Disk I/O), network (Net I/O), or another thread (Wait). Thread states indicate whether threads are running code or waiting.
Allocated memory is all memory that methods request. Survived memory is the part that remains alive after garbage collection. A high share of survived memory (retention) can indicate a memory leak.
Use
Profiling to find the code behind slow requests, CPU spikes, memory pressure, and blocked threads. The following use cases show what you can do with the app.
Profiling with the context your team already uses.
Profiling