Community
Participate
Working Groups
It doesn't seem that more than one query can be run in headless mode. For example: ./mat.app/Contents/MacOS/MemoryAnalyzer -consoleLog -nosplash -application org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -command=thread_overview org.eclipse.mat.api:query -vmargs -Xmx4g
You can run more than one report, but the options and report specifications are collected together, so the second command setting will overwrite the first. See org.eclipse.mat.internal.apps.ParseSnapshotApp It gets tricky to see how to do what you want in a compatible fashion. 1. Only take options up to the reports. - breaks people who specify options after the reports 2. Also add options if they are the last on the line (no more report) - complicated to explain 3. If an option is redefined, run the reports and options specified so far before continuing - complicated Consider MemoryAnalyzer org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -format=txt -command=thread_overview org.eclipse.mat.api:query The -format=txt would also apply to the histogram 4. If an option is redefined, run the reports and options specified up to the last report before continuing Consider MemoryAnalyzer org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -format=txt -format-csv MemoryAnalyzer org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -format=txt -format-csv org.eclipse.api:leak_suspects 5. Have an argument which means process everything up to this point E.g. MemoryAnalyzer -consoleLog -nosplash -application org.eclipse.mat.api.parse core.dmp -command=histogram org.eclipse.mat.api:query -: -command=thread_overview org.eclipse.mat.api:query Semicolon is bad as it needs to be escaped on Linux 6. Write your own report with a different option, say command2 7. Run two separate commands - HPROF parser is pretty quick at reloading Is there any Linux / Unix command that behaves like any of these. E.g. can you run a C compiler with one command on two files, defining the same macro from the command line differently for both?
Hey Andrew, Good point that we don't want to break existing users/scripts. I'm not aware of any command line programs with this sort of use case. I like option 5. Option 6 is a good workaround. Thanks
This issue has been migrated to https://github.com/eclipse-mat/org.eclipse.mat/issues/35.