4 ms·
An alternative to avoid safepoints (only samples executing threads) var r = new RecordingStream(); r.enable("jdk.ExecutionSample").withStackTrace().wit
by haglin 4y ago
An alternative to avoid safepoints (only samples executing threads)
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();
...
- omazurov 4y agoYou get JFR's precision but inherit its blind spots as described in [1]: > 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). [1] https://github.com/apangin/java-profiling-presentation https://github.com/apangin/java-profiling-presentation
- parttimenerd 4y agoI would rather use Andrei Pangin's async-profiler than doing something custom with jstack.