Mysterious memory consumption can cause tremendous problems in production applications—especially when default JVM settings are used that end up causing performance issues. AppDynamics can help you troubleshoot and identify memory leaks even in a high-volume production environment.
Using a solution like AppDynamics you can easily monitor the different memory pool sizes over time to understand just how close your application is to getting a Java memory leak so you can better fine tune your JVM memory settings and prevent Java memory leaks. For example, OutOfMemory Exceptions can occur when PermGen space is exhausted by application code that is sometimes bigger than the default Perm Gen space in memory (typically 64-128MB).
Another common reason for OutOfMemory exceptions is when the application queries large amounts of data from relational databases and tries to persist and process it in JVM memory. With AppDynamics you can perform memory leak detection and also track heap usage over time, object count and physical size (MB) of the objects residing in memory, giving you great visibility into how much data is being persisted in the JVM at any one time and how much of your memory is being exhausted by different types objects and data structures. You can also correlate this information with garbage collection cycles to understand how often memory is reclaimed by the JVM. Garbage Collection is a "stop the world" event in the JVM so it's important to identify how frequently this occurs and what impact it can have on your application response times.
If you indeed have memory leaks in Java, let’s face it: spending hours trawling through thread dumps and profilers isn’t fun. And you don’t want to try a heap dump when the overhead could potentially bring down your app. But AppDynamics can spot and flag leaking data structures:
AppDynamics automatically tracks the size and growth of Java Collections like HashMap, HashSets and ConcurrentLinkedQueues over time as data in your application is requested and persisted within JVM memory. AppDynamics uses intelligent algorithms to detect which Collections may potentially be leaking, and flags these Collections automatically so users can drill-down, and inspect the contents, to better understand what objects are being allocated, and how much memory these objects are consuming inside the Collection.