Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
MAT headless mode
# This script parses a heap dump.
# Usage: <path/to/dump.hprof> [report]*
# The leak report has the id org.eclipse.mat.api:suspects
# The top component report has the id org.eclipse.mat.api:top_components
./MemoryAnalyzer -consolelog -application org.eclipse.mat.api.parse "$@"
# run with './ path_to_heapdump'
nohup ./ $1 org.eclipse.mat.api:suspects org.eclipse.mat.api:overview org.eclipse.mat.api:top_components -vmargs -Xmx96g -XX:-UseGCOverheadLimit > mat_report.out &

This comment has been minimized.

Copy link
Owner Author

@mrbuk mrbuk commented May 20, 2015


Note: The script should be part of your MAT distribution. So to run a suspect report the second script and the MAT distribution is needed.


First see if the heap size defined in the is right for your case. If so execute ./ heap_dump

As a result an archive with the report in form of HTML files will be created. (Resulting files are usually located in the MAT directory if you have executed the application from that location).

Note: This will only create the suspects, overview and top components report. If you want other stuff or only one report (e.g. suspect) replace the report id from the script with only the desired report and execute directly from command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment