by haglin · 3y ago · 0 comments
var r = new RecordingStream();
r.enable("jdk.ExecutionSample").withStackTrace().withPeriod(Duration.ofMillis(1));
r.onEvent("jdk.ExecutionSample", e -> {
store.addSample(e.getStackTrace().getFrames());
});
r.startAsync();
...> demo1: ... JFR will not report anything useful at all, since it cannot traverse stack traces when JVM is running System.arraycopy()
I'd rather run jstack in a loop than lose System.arraycopy() (or, in fact, any native code be it JVM's or JNI).