Automatic Leak Detection
You can access Automatic Leak Detection on the Memory tab of the Node Dashboard. Automatic Leak Detection is disabled by default because it increases overhead on the JVM. You should enable leak detection mode only when you suspect a memory leak problem. Turn off Automatic Leak Detection after you identify the cause for the leak.
Automatic Leak Detection uses On Demand Capture Sessions to capture actively used collections, any class that implements JDK Map or Collection interface during the capture period. The default capture period is 10 minutes.
Splunk AppDynamics tracks every Java collection that meets the following criteria:
- The collection has been alive for at least 30 minutes.
- The collection has at least 1000 elements.
- The collection Deep Size is at least 5 MB. The agent calculates Deep Size by traversing recursive object graphs of all the objects in the collection.
The following node properties define the defaults for leak detection criteria:
-
minimum-age-for-evaluation-in-minutes
-
minimum-number-of-elements-in-collection-to-deep-size
-
minimum-size-for-evaluation-in-mb
See App Agent Node Properties.
The Java Agent tracks the collection and identifies potential leaks using a linear regression model. You can identify the root cause of the leak by tracking frequent access to the collection over a period of time.
After it qualifies a collection, Splunk AppDynamics monitors the collection size for a long-term growth trend. Positive growth indicates the collection is the potential source of a memory leak.
After Splunk AppDynamics identifies a leaking collection, the Java Agent automatically triggers diagnostics every 30 minutes. The diagnostics capture a shallow content dump and activity traces of the code path and business transactions that access the collection. You can drill down into any leaking collection monitored by the agent, to manually trigger Content Summary Capture and Access Tracking sessions.
You can also monitor memory leaks for custom memory structures. Typically custom memory structures are used as caching solutions. In a distributed environment, caching can easily become a prime source of memory leaks. It is therefore important to manage and track memory statistics for these memory structures. To do this, you must first configure custom memory structures. See Custom Memory Structures for Java.