See batch mode:
https://help.eclipse.org/latest/topic/org.eclipse.mat.ui.help/tasks/batch.html?cp=55_3_14
You will need a big heap to analyse your dump. See
https://help.eclipse.org/latest/index.jsp?topic=/org.eclipse.mat.ui.help/welcome.html to edit the heap size for MAT.
If you still don’t have a big enough heap then try this.
If you just want a quick count of which objects are in the heap then this might help. Discarding objects means that they are not processed by MAT, but a count of them is kept in the unreachable objects
histogram.
del ..\..\..\matdump_20221221_145125.index
ParseHeapDump ..\..\..\matdump_20221221_145125.hprof.gz -discard_ratio=100 "-discard_pattern=.+" -command=unreachable_objects org.eclipse.mat.api:query
Unpack and view
..\..\..\matdump_20221221_145125_Query.zip
You could then delete the index, and reparse discarding say 50% of some of the top few classes and run the leak suspects report.
del ..\..\..\matdump_20221221_145125.index
ParseHeapDump ..\..\..\matdump_20221221_145125.hprof.gz -discard_ratio=50 "-discard_pattern=java.lang.String|
org.eclipse.swt.graphics.Point" -command=unreachable_objects org.eclipse.mat.api:suspects
With luck you won’t have discarded the important objects and the report will be meaningful.
Andrew Johnson
Hello MAT dev team,
I appreciate the great work you folks are doing, thanks for that!
I'd like to analyze a 120 GB heap dump, and I'd prefer not to download it locally to do a UI based traversal/exploration but rather skim through it programmatically. What are the options?