Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Memory Analyzer » MAT command line with IBM PHD files?
MAT command line with IBM PHD files? [message #1831169] Wed, 12 August 2020 21:37 Go to next message
vinay chilakamarri is currently offline vinay chilakamarriFriend
Messages: 2
Registered: August 2020
Junior Member
I am trying to extract MAT generated reports using the command line feature and was able to use the below link and command to generates reports successfully:

https://wiki.eclipse.org/MemoryAnalyzer/FAQ

/usr/java5_64/jre/bin/java -Dosgi.bundles=org.eclipse.mat.dtfj@4:start,org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start -jar plugins/org.eclipse.equinox.launcher_*.jar -consoleLog -application org.eclipse.mat.api.parse path/to/mydump.dmp.zip org.eclipse.mat.api:suspects org.eclipse.mat.api:overview org.eclipse.mat.api:top_components




This works perfectly for HPROF files. However, when I try with Portable heapdumps from IBM (PHD file) the command would fail with the exception below:



!ENTRY org.eclipse.osgi 4 0 2020-08-12 00:22:38.019
!MESSAGE Application error
!STACK 1
org.eclipse.mat.SnapshotException: Error opening heap dump 'heapdump.20160404.083909.9480.0002.phd'. Check the error log for further details.
	at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.parse(SnapshotFactoryImpl.java:268)
	at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.openSnapshot(SnapshotFactoryImpl.java:126)
	at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:145)
	at org.eclipse.mat.internal.apps.ParseSnapshotApp.parse(ParseSnapshotApp.java:134)
	at org.eclipse.mat.internal.apps.ParseSnapshotApp.start(ParseSnapshotApp.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Caused by: java.io.IOException: Not a HPROF heap dump
	at org.eclipse.mat.hprof.AbstractParser.readVersion(AbstractParser.java:130)
	at org.eclipse.mat.hprof.Pass1Parser.read(Pass1Parser.java:84)
	at org.eclipse.mat.hprof.HprofIndexBuilder.fill(HprofIndexBuilder.java:80)
	at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.parse(SnapshotFactoryImpl.java:222)
	... 17 more




I ran this command on the same plugins folder where MAT had the DTFj extension installed. And I could see that the DTFj jars were placed in the configuration folder when I installed that plugin. When I try to open the same PHD file on the GUI, it works fine.

I was wondering if there is a way to get the command line launcher to parse the PHD file format and generate reports out of it.

Thanks!
Re: MAT command line with IBM PHD files? [message #1831178 is a reply to message #1831169] Thu, 13 August 2020 05:34 Go to previous messageGo to next message
vinay chilakamarri is currently offline vinay chilakamarriFriend
Messages: 2
Registered: August 2020
Junior Member
I was able to go past this. The problem seems to be that I had a copy of plugins and configuration folder in a different location where I was running the command line which I did not notice.

Once I moved back to the MAT install folder and executed the command, it worked fine.
Re: MAT command line with IBM PHD files? [message #1841059 is a reply to message #1831178] Sun, 02 May 2021 17:15 Go to previous message
Ruchir Verma is currently offline Ruchir VermaFriend
Messages: 2
Registered: May 2021
Junior Member
Hi Vinay,

Would you be able to share more details as to which version of MAT and exactly what command you used to make it work?

Regards,
Ruchir
Previous Topic:MAT Blank Screen when using MacOS Big Sur
Next Topic:Not A HPROF heap dump when parsing PHD files
Goto Forum:
  


Current Time: Sat Apr 20 06:12:55 GMT 2024

Powered by FUDForum. Page generated in 0.02343 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top