Memory leaks in Java applications can readily occur due to numerous causes. Java memory leak tools can be used to troubleshoot these memory leaks. However, many Java monitor tools in the market do not provide enough low-level memory consumption details or allow you to drill deep enough into code to identify classes or fields causing the leaks. These rudimentary Java memory leak tools may be able to highlight large and fast growing memory leaks. However, they do not have the capability to allow you to trace memory leaks down to the problematic object instance itself. Additionally, they may not be able to detect small incremental leaks caused by multiple objects or leaks caused by complex object structures.
Dynatrace, the market leader in APM solutions, offers comprehensive Java app monitoring that includes memory leak detection capabilities that are the most fine-grained in the market. Dynatrace’s monitoring tools allow you to view runtime heap memory consumption by each object instance. Heap consumption information is provided by Java memory leak tools that generate memory snapshots or dumps. Dynatrace Java memory leak detection tools enable you to obtain two types of memory snapshots:
Trending snapshots — These snapshots are generated several times over a period of time to illustrate any increasing trends in memory consumption. Each snapshot shows you the number of instances of each class and the corresponding memory occupied by these instances at a particular time. When two or more snapshots are made, Dynatrace Java memory leak tools can provide a graphical trending plot to show you the increase or decrease in memory consumed by the instances of a specific class between each snapshot. An increase indicates a possible memory leak if you did not expect that class to grow as much as observed.
Deep memory snapshot — A deep memory snapshot is a full heap memory dump of all objects including primitive fields and String objects. After performing trending snapshots and identifying classes that have grown more than expected in size, you can perform a deep memory snapshot using Dynatrace Java memory leak tools to find the specific object instance or instances that you observed in your trending snapshots. Dynatrace Java performance tools automatically generate a deep memory snapshot if a Java application throws an OutOfMemory exception. Because this exception is caused by a memory leak, you can use this auto-generated snapshot to find the problematic class that caused the leak.
As the leader in the APM market, Dynatrace offers turnkey tools for monitoring Java applications. These tools enable you to monitor the performance of your Java applications and troubleshoot any performance issues such as memory leaks and execution bottlenecks. Dynatrace’s Java profiling tools and memory leak tools improve your productivity by streamlining performance troubleshooting tasks and enable you to dive deep into Java code to find the root cause of performance problems. Java profiling tools provide execution time information at the method level, and Java memory leak tools drill down to object instances that cause memory leaks. With Dynatrace, you can expeditiously solve any performance problems and optimize your Java applications for maximum performance.