Configure Thread Snapshots in APM Agent

The thread snapshots feature allows thread stack snapshots collection which can be used for deep dive analysis.

Thread snapshots allows collection of traces like thread stack snapshots, thread memory overhead, thread cpu overhead and gc impact on trace. It collects the thread stack snapshots and stack related data like state and locks, at a specific interval.

Users can enable thread stack snapshots collection for taking stack dump of spans. It provides user code stack visibility.

Thread snapshots collection default time interval is 250 ms.

This feature is disabled by default.

APM Java Agent and APM Tracer support thread snapshots collection. For details about configuring thread snapshots in APM Tracer, see Configure Thread Snapshots in APM Tracer.


  1. Thread Snapshots require JDK8 or higher.

  2. Thread snapshots is supported on APM Java Agent 1.4 version or higher.

Enable Thread Snapshots

After the APM Java Agent has been provisioned, you can enable the thread snapshots feature by updating the file which must be present under the following location:


  • Open the file.
  • Update the following property to true value: 

    By default, thread snapshots property value is false (Feature disabled).

Configuration Properties

The below table shows the thread snapshots properties than can be configured at runtime.

Property Name Description Unit Default Value Supported Values Enable or disable deepdive snapshot collection. String false true/false Maximum percentage of per minute incoming traces to export them to collector. Percentage 100


Maximum: 100 Maximum number of top traces per minute to export them to collector. Number 200


Maximum: 1500 Interval at which thread snapshot data will be collected. Milliseconds 250


Maximum: 300000 Maximum number of snapshots allowed per trace. Number 16

Minimum: 1

Maximum: 16 Maximum stack trace frames collected for any thread. Number 256

Minimum: 1

Maximum: 256 Print deep dive logs, which are equal or above to this property value. String INFO

DEBUG, INFO, WARN, SEVERE Maximum process CPU usage. It's recommended to maintain overall process CPU usage under this threshold. Number 90

Minimum: 1

Maximum: 90 Minimum threshold to maintain overall deepdive CPU usage. Percentage 3

Minimum: 1

Maximum: 5 Maximum threshold to maintain overall deepdive CPU usage. Percentage 5

Minimum: 5

Maximum: 20 Minimum threshold for a trace. Milliseconds 50

Minimum: 50

Maximum: 60000 Maximum threshold for a trace. Milliseconds 60000

Minimum: 60000

Maximum: 600000

Verify Thread Snapshots

  • To verify that thread snapshots feature has been initialized, check the log file from following location: $DOMAIN_HOME/oracle-apm-agent/deepdive/<server-name>/ApmDeepDiveAgent.log.

    The log file should have look like the following:
     INFO [main] <DeepDiveManager> DeepDiveManger initialized successfully. 
  • To verify that thread snapshots feature has been configured properly and data is being uploaded to Application Performance Monitoring, use the Snapshot view option from View Trace or Span Details.