TPTP heap tools
Memory Analysis Tooling Synergies
The Use Cases are under construction! Let me know what you think!
Use Case A: Acquire Heap Dump while Profiling
During a profiling session, the user wants to analyze the complete objects graph. He selects "Acquire Heap Dump", the agent triggers the VM to write a heap dump, the dump is transferred (if necessary) to the local machine, parsed and displayed in the Memory Analyzer views.
This is the most basic integration scenario: get a dump from the VM currently profiled. It is similar to Bugzilla 229449 enhancement to provide a button inside the Memory Analyzer perspective to acquire a heap dump on demand.
- tbd: can the agent trigger the VM to write a heap dump in the appropriate (e.g. HPROF) format?
- tbd: what are implications of transferring the dump to the local machine?
Use Case B: Analyze Instances in the Heap Dump
Enable direct navigation from the allocation site to the object in the object graph of the heap dump.
While viewing the Object Allocations, the user recognizes that the number of surviving generations for a particular package increases continuously. Those are objects which have been allocated during the profiling session but are not garbage collected during a Full GC. The user selects "View Live Instances in Heap Dump". If the user previously acquired a heap dump, he will be prompted whether to use that heap dump (which is faster but might not contain all live instances). Otherwise a new heap dump is acquired and the Memory Analyzer views is opened.
The list of selected life instances is displayed. This allows to continue the analysis to answer questions like
- Why is object X not garbage collected? (Path to GC Roots),
- What is the common reference chain keeping the objects alive? (Merge Shortest Paths to GC Roots)
- What is the total memory kept alive? (Retained Size) (Which is different from the Active Size displayed in the Object Allocation view)
- tbd: Is it possible to associate allocation numbers with concreate instances? For example, the Object Allocations view displays X live instances. To display those objects in the Memory Analyzer, we need know the object addresses of these objects at the time the heap dump was taken. Why at the time? Whenever Garbage Collector (GC) moves an instances around, it gets a new address and all references are updated accordingly.
Use Case C: Analyze Allocation Stack Traces of Instances Found in the Heap Dump
Go from an object directly to the allocation stack trace.
While walking the heap, the user wants to know the allocation site of an object, i.e. where the object has been created. All objects where there is an allocation site available, are decorated with text/image etc. It should be possible to select one or more objects, and get a merged stack trace of the allocation site.
- tbd: Does the TPTP profiler currently collect allocation stack traces? And if so, is it done on an instance level?
- tbd: For decoration, the Memory Analyzer would need all object addresses of instances with allocation stack trace at the time the heap dump was taken.
Use Case D: Set a Debugging Break Point to Create Heap Dump
The user wants to create a heap dump at a specific point in time.
This use case is very similar to Use Case A. Only the heap dump is not triggered interactively, but when reaching the debugging break point.
- tbd: Does the TPTP Profiler support "profiling break points"? I haven't seen in the docu, but I have seen it with NetBeans.