Skip to content

Instantly share code, notes, and snippets.

@inikolaev
Last active August 28, 2019 02:57
Show Gist options
  • Save inikolaev/acc3d34d64dd6da080851f4d93953d93 to your computer and use it in GitHub Desktop.
Save inikolaev/acc3d34d64dd6da080851f4d93953d93 to your computer and use it in GitHub Desktop.

Commands used to run profiler:

  • Event cpu

    java -agentpath:libasyncProfiler.so=start,svg,file=flamegraph-cpu.svg,interval=1ms,threads -cp target/classes ProfileIdle

  • Event wall

    java -agentpath:libasyncProfiler.so=start,svg,file=flamegraph-wall.svg,interval=1ms,event=wall,threads -cp target/classes ProfileIdle

Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
public class ProfileIdle {
static void work() {
double sum = 0;
for (int i = 0; i < 200000000; i++) {
sum += Math.atan(i);
}
System.out.println(sum);
}
public static void main(String[] args) throws InterruptedException {
work();
Thread.sleep(10000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment