eclipse / jifa

🔬 Online Heap Dump, GC Log, Thread Dump & JFR File Analyzer.
https://eclipse.github.io/jifa/
Eclipse Public License 2.0
541 stars 96 forks source link

SnapshotException #294

Closed wuzhengxuan closed 2 months ago

wuzhengxuan commented 2 months ago

error: org.eclipse.jifa.hda.api.AnalysisException: org.eclipse.mat.SnapshotException: The HPROF parser encountered a violation of the HPROF specification that it could not safely handle. This could be due to file truncation or a bug in the JVM. Please consider filing a bug at eclipse.org. To continue parsing the dump anyway, you can use -DhprofStrictnessWarning=true or set the strictness mode under Preferences > HPROF Parser > Parser Strictness. See the inner exception for details.

add the -DhprofStrictnessWarning=true in JVM params?

wuzhengxuan commented 2 months ago

I am add the -DhprofStrictnessWarning=true in JVM params,it does't wrok.

wuzhengxuan commented 2 months ago

It worked in MAT 1.15 on my PC. Can you update the eclipse-mat-deps to 1.15?

D-D-H commented 2 months ago

Hi @wuzhengxuan  From the error message, the dump is incomplete or has some wrong data, so even if MAT 1.15 can parse it, there may be some wrong analysis results.

D-D-H commented 2 months ago

You can update the mat version locally by modifying the following line:

https://github.com/eclipse/jifa/blob/97e72c0e4e2c1508e1b002578fcb675baf7b57ee/analysis/heap-dump/eclipse-mat-deps/eclipse-mat-deps.gradle#L93-L98

https://github.com/eclipse/jifa/blob/97e72c0e4e2c1508e1b002578fcb675baf7b57ee/analysis/heap-dump/eclipse-mat-deps/eclipse-mat-deps.gradle#L71-L90

wuzhengxuan commented 2 months ago

You can update the mat version locally by modifying the following line:

https://github.com/eclipse/jifa/blob/97e72c0e4e2c1508e1b002578fcb675baf7b57ee/analysis/heap-dump/eclipse-mat-deps/eclipse-mat-deps.gradle#L93-L98

https://github.com/eclipse/jifa/blob/97e72c0e4e2c1508e1b002578fcb675baf7b57ee/analysis/heap-dump/eclipse-mat-deps/eclipse-mat-deps.gradle#L71-L90

Thanks, I'm try to update it.Does org.eclipse.osgi need to be updated?

D-D-H commented 2 months ago

I'm try to update it.Does org.eclipse.osgi need to be updated?

https://github.com/eclipse/jifa/blob/97e72c0e4e2c1508e1b002578fcb675baf7b57ee/analysis/heap-dump/eclipse-mat-deps/eclipse-mat-deps.gradle#L115

wuzhengxuan commented 2 months ago

You can update the mat version locally by modifying the following line:

https://github.com/eclipse/jifa/blob/97e72c0e4e2c1508e1b002578fcb675baf7b57ee/analysis/heap-dump/eclipse-mat-deps/eclipse-mat-deps.gradle#L93-L98

https://github.com/eclipse/jifa/blob/97e72c0e4e2c1508e1b002578fcb675baf7b57ee/analysis/heap-dump/eclipse-mat-deps/eclipse-mat-deps.gradle#L71-L90

Hi,@D-D-H,I'm update the https://download.eclipse.org/mat/1.14.0/update-site/ to 1.15.0,the project can build,but analysis the hprof file has error:java.lang.NoSuchMethodError: 'java.lang.String org.eclipse.mat.hprof.ui.HprofPreferences.methodsAsClasses()'.How to fix it?Thanks.

wuzhengxuan commented 2 months ago

I suspect it's an issue with the ClassLoader, which did not load the heap-dump module hook org.eclipse.mat.hprof.ui.HprofPreferences. Now I don't know how to fix it。

wuzhengxuan commented 2 months ago

After upgrading Jifa to MAT 1.15, it still doesn't work. I found that the local MAT 1.15 had Parser Strictness set to 'warn', so it could open the file. It is indeed a file error issue as you mentioned. However, what's strange is that the .hprof file can be opened normally in strict mode, but after compressing it to .gz, it cannot be opened. I will try to submit an issue to MAT. Thank you.