eclipse-mat / mat

The Eclipse Memory Analyzer is a fast and feature-rich Java heap dump analyzer that helps you find memory leaks and reduce memory consumption.
https://eclipse.dev/mat/
Eclipse Public License 2.0
63 stars 12 forks source link

Unable to click the reference pattern hyperlink from heap dump file generated via linux command #45

Open eclipsewebmaster opened 4 months ago

eclipsewebmaster commented 4 months ago

| --- | --- | | Bugzilla Link | 582803 | | Status | NEW | | Importance | P3 critical | | Reported | Dec 21, 2023 08:57 EDT | | Modified | Feb 13, 2024 23:55 EDT | | Version | 1.15 | | Reporter | Gowtham K |

Description

Unable to click the reference pattern hyperlink from heap dump file generated via linux command.

Kindly suggest any ideas or parameters to access the reference pattern hyperlink to analyze deeper.

eclipsewebmaster commented 4 months ago

By Gowtham K on Dec 28, 2023 01:48

we have only a Linux server to analyze the heap dump, able to see only the leak suspect but we need to analysis deeper to know the cause. Kindly suggest to analysis the heap dump deeper in Linux command line.

eclipsewebmaster commented 4 months ago

By Andrew Johnson on Jan 03, 2024 11:31

It's a fairly common pattern to have a Linux server analysing big dumps, then view the leak suspects report from another computer.

There is a limit to how much information can be sensibly be included in the HTML report. We have expanded this a little in MAT 1.15.0 in the thread information etc.

Once the dump has been parsed on the big server, it is possible to move the dump and all the index files and the reports to another computer and run MAT there. MAT should use a lot less heap in this situation, so you might be able to open the Run Expert System Test > Open Report menu item to view the report in MAT. The hyperlinks should then work.

Is there a particular item you want to see from the reference pattern hyperlink? I think the hyperlink looks something like:

mat://query/merge_shortest_paths+SELECT+*+FROM+java.lang.Class+s+WHERE+dominatorof%28s%29+%3D+null%3B+-groupby+FROM_GC_ROOTS_BY_CLASS+-excludes+java.lang.ref.Reference%3Areferent+java.lang.ref.Finalizer%3Aunfinalized+java.lang.Runtime%3A%3CUnfinalized%3E%3B

Having the full merge_shortest_paths tree in the HTML report is going to be too big.

Another idea is to run an X-Server on your local computer and set up DISPLAY etc. on your server computer (if you have permissions to install and run MAT in GUI mode on your big Linux server).

eclipsewebmaster commented 4 months ago

By Gowtham K on Jan 04, 2024 07:56

Your suggestions are beneficial to my ends; The heap dump has been parsed on the large server, but the client will not share the dump file (.hprof), only the index file. Is there a Linux command that will allow me to access the reference pattern hyperlink?

If MAT is installed in a VDI environment but the client refuses to share the dump file (.hprof). Is there a way to open an index file other than a (.hprof) file in MAT to analyze a specific piece of code?

eclipsewebmaster commented 4 months ago

By Andrew Johnson on Jan 05, 2024 08:46

The mat: hyperlinks only make sense to Memory Analyzer when it has opened the \ HPROF file.

If the client is worried about sensitive data, then the Export HPROF query might help.

This can generate a new hprof file with various types of data removed:

https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.mat.ui.help%2Ftasks%2Fexportdump.html

Please read through the above documentation and perhaps you and your client can agree a suitable level of redections.

eclipsewebmaster commented 4 months ago

By Gowtham K on Jan 09, 2024 00:00

After attempting the point in the documentation, heap dump parsing takes more than 11 hours for 7.1GB of heap dump. Kindly share an alternate solution in the Linux command.

eclipsewebmaster commented 4 months ago

By Andrew Johnson on Jan 21, 2024 09:23

It would be useful to see the error log from MAT. Window > Error Log > Save as

It would also be useful to see the start up options for MAT in \ MemoryAnalyzer.ini\ in the same folder as the executable used to run MAT

eclipsewebmaster commented 4 months ago

By Gowtham K on Feb 05, 2024 00:43

FYI, I attached the error log while parsing a 42 GB dump file using Linux command.

org.eclipse.mat.SnapshotException: Illegal primitive object array type when parsing 42 GB heap dump using Linux command

Error message:

org.eclipse.mat.SnapshotException: Illegal primitive object array type\ at org.eclipse.mat.hprof.Pass1Parser.readPrimitiveArrayDump(Pass1Parser.java:707)\ at org.eclipse.mat.hprof.Pass1Parser.readDumpSegments(Pass1Parser.java:384)\ at org.eclipse.mat.hprof.Pass1Parser.read(Pass1Parser.java:186)\ at org.eclipse.mat.hprof.HprofIndexBuilder.fill(HprofIndexBuilder.java:80)\ at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.parse(SnapshotFactoryImpl.java:222)\ at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.openSnapshot(SnapshotFactoryImpl.java:126)\ at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:147)\ at org.eclipse.mat.internal.apps.ParseSnapshotApp.parse(ParseSnapshotApp.java:136)\ at org.eclipse.mat.internal.apps.ParseSnapshotApp.start(ParseSnapshotApp.java:108)\ 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)

Kindly suggest any ideas to overcome this issue.

eclipsewebmaster commented 4 months ago

By Gowtham K on Feb 13, 2024 23:55

Any update on this?

dadeveau commented 2 months ago

Hi team,

I have just released CLIMAT, a plugin extension to MAT which enables no-GUI traversal of HPROF files. I created this tool to solve this exact use case of analyzing heap dumps without needing to extract them to a separate server with a GUI. Please do take a look and let me know any questions you have.

This does not relate to Gowtham's most recent update with the Pass1Parser error (that appears to be an unrelated issue).

CC @ajohnson1 since we discussed this some time ago.