Automatic Leak Detection Versus Monitoring Custom Memory Structures

Automatic leak detection captures memory usage data for all map and collection libraries in a JVM session. However, custom memory structures may not contain all collection objects. For example, you may have a custom cache or a third-party cache such as Ehcache for which you want to collect memory usage statistics.

Using custom memory structures, you can monitor any custom object created by the app and the size data can be traced across JVM restarts. Automatic leak detection is typically used to identify leaks, while custom memory structures are used to monitor large coarse-grained custom cache objects.

The following provides the workflow for configuring, monitoring, and troubleshooting custom memory structures. You must configure custom memory structures manually.

  1. On the Tiers & Nodes dashboard, use the Automatic Leak Detection, On Demand Capture Session feature to determine which classes aren't being monitored, for example, custom or third-party caches such as EhCache.
  2. Configure Custom Memory Structures and then restart the JVM if necessary.
  3. Enter the fully-qualified classname on the Create New Instance Tracker window and click Save.
    Splunk AppDynamics automatically tracks long-lived Java collections (HashMap, ArrayList, and so on) with Automatic Leak Detection.
  4. Turn on Custom Memory Structures monitoring to detect potential memory leaks in the custom memory structures you have configured.
  5. Drill down into leaking memory structures for details that will help you determine where the leak is.
  6. To identify custom memory structures:
    1. Navigate to Memory > Automatic Leak Detection and click On.
    2. Click Start On Demand Capture Session to capture information on which classes are accessing which collections objects.
      Use this information to identify custom memory structures.
Splunk AppDynamics captures the top 1000 classes, by instance count.