Snapshot Comparison for Growing Objects
Tools like Eclipse MAT and HeapHero compare heap dumps or memory snapshots taken at different times, highlighting objects or classes whose instance counts or retained sizes are steadily increasing, signaling a potential leak.
The top 3
- Top 3 Metrics for Identifying Leaky Growing Objects: When comparing heap snapshots to find memory leaks, focus on the delta of 'Retained Heap Size' (memory freed if an object is GC'd), 'Instance Count' (number of objects), and 'Shallow Heap Size' (memory used by the object itself) to pinpoint actual problematic growing objects.
- Advanced Filters for Pinpointing Root Causes of Growth: To effectively diagnose growing objects, utilize advanced heap dump analysis features like the 'Dominator Tree' to identify objects preventing garbage collection, 'Merged Paths' to group retention paths by class, and Object Query Language (OQL) for highly specific searches and filtering.
- Optimal Snapshot Timing for Growth Analysis: Strategically capture heap snapshots at application startup, after a stable period, and then at regular intervals (e.g., every 30-60 minutes) or after specific problematic operations to effectively track and compare object growth patterns.
Sources
Open the full topic