Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse visualvm nps generated by visualvm 2.0.1 #65

Open
crzyjcky opened this issue Apr 24, 2020 · 4 comments
Open

Unable to parse visualvm nps generated by visualvm 2.0.1 #65

crzyjcky opened this issue Apr 24, 2020 · 4 comments

Comments

@crzyjcky
Copy link

Hi, I ran into issue where sjk seems unable to understand nps format.

VisualVM: v2.0.1
Jdk: v14

Unable to parse file './profiler-snapshot2.nps'. Parser config: SJK Thread Dump (Magic: TRACEDUMP_1, TRACEDUMP_2), SJK Genereic Event Dump (Magic: EVENTDUMP_1), JStack dump parser
Input files
  ./profiler-snapshot2.nps

Unable to parse file './profiler-snapshot2.nps'. Parser config: SJK Thread Dump (Magic: TRACEDUMP_1, TRACEDUMP_2), SJK Genereic Event Dump (Magic: EVENTDUMP_1), JStack dump parser
Stream reader error: java.io.IOException: Invalid magic
java.io.IOException: Invalid magic
	at org.gridkit.jvmtool.stacktrace.MagicReader.readMagic(MagicReader.java:33)
	at org.gridkit.jvmtool.stacktrace.ThreadEventCodec.createEventReader(ThreadEventCodec.java:30)
	at org.gridkit.jvmtool.AbstractEventDumpSource.openReader(AbstractEventDumpSource.java:151)
	at org.gridkit.jvmtool.AbstractThreadDumpSource.openReader(AbstractThreadDumpSource.java:119)
	at org.gridkit.jvmtool.AbstractEventDumpSource$1.produceNext(AbstractEventDumpSource.java:128)
	at org.gridkit.jvmtool.event.ChainedEventReader.hasNext(ChainedEventReader.java:68)
	at org.gridkit.jvmtool.event.ShieldedEventReader.seekNext(ShieldedEventReader.java:66)
	at org.gridkit.jvmtool.event.ShieldedEventReader.hasNext(ShieldedEventReader.java:95)
	at org.gridkit.jvmtool.event.ShieldedEventReader.seekNext(ShieldedEventReader.java:66)
	at org.gridkit.jvmtool.event.ShieldedEventReader.hasNext(ShieldedEventReader.java:95)
	at org.gridkit.jvmtool.event.MorphingEventReader.hasNext(MorphingEventReader.java:33)
	at org.gridkit.jvmtool.hflame.JsonFlameDataSet.feed(JsonFlameDataSet.java:97)
	at org.gridkit.jvmtool.hflame.cmd.FlameGraphGeneratorCmd$FlameGen.run(FlameGraphGeneratorCmd.java:100)
	at org.gridkit.jvmtool.cli.CommandLauncher.start(CommandLauncher.java:134)
	at org.gridkit.jvmtool.SJK.main(SJK.java:14)
0 samples processed
No data omit report generation```
@aragozin
Copy link
Owner

SJK is using VisualVM from JDK classpath to parse files. That means parsing of VisualVM files will work only on Java 8.

@palec911
Copy link

@aragozin I have the same issue but I'm explicitly using the same java to run sjk as the one i used to run visualVM and export the nps file with : /usr/lib/jvm/jdk1.8.0_202_x64/bin/java -jar sjk.jar flame -f snap1.nps -o report.html
Also made sure with update-alternatives --config java and JAVA_HOME that my default java is the same
Am i missing something?

@aragozin
Copy link
Owner

Trick in SJK is to use Visual VM jars from local JDK (which have Visual VM 1.x bundled). Probably file format have changed in Visual VM 2.x
Provided poor quality of Visual VM profiling data, I'm not confident I would like to include its parser to SJK. But I need to look at new version first.
So far I can only suggest you to sample with SJK instead of VisualVM if you want process data with SJK. BTW Flight Recorder files a supported too, so if you on Java 11+ you can use with SJK too.

@phillipse01
Copy link

@palec911 I am having the same issue - were you able to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants