-
Notifications
You must be signed in to change notification settings - Fork 43
Debugging and Profiling
Trass3r edited this page Jul 7, 2025
·
2 revisions
RenderDoc is a widely used graphics frame debugger.
- Getting started
- Launch OpenKeeper with the
-debugparameter to get descriptive OpenGL object names. - If you use VSCode you can get the full dev commandline via
"console": "integratedTerminal". You can also just build a .jar first.
Example:java @xyz.argfile toniarts.openkeeper.Main -level mpd1 -debug
JFR is built into the JVM (Java 11+).
You can record a session and view it in JMC or post-process it into flamegraphs with async-profiler tools.
"vmArgs": "-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints -XX:StartFlightRecording=delay=20s,maxsize=10M,disk=false,dumponexit=true,filename=recording.jfr,settings=profile,path-to-gc-roots=true"This starts JFR after 20 seconds and writes a recording.jfr file on exit.
jfrconv --threads --dot -X ".+glfwSwapBuffers|.+emitEvent" --total --simple --highlight "State[.$]|Control|System" --title 'Time spent' recording.jfrThe generated html flamegraphs can be shared e.g. via Gist and https://gistpreview.github.io/.
VisualVM is a free Java profiler.
There is a VSCode extension which takes care of setting correct source roots and makes launching it straightforward.
- Use Sampler or Profiler.
- Enable the Hot Spots view and sort by Self Time to spot expensive methods.
- Right-click a method and select Find in Forward Calls.
- The Heap Histogram gives an overall idea but is not too useful.
- Take a heap dump and run Compute Retained Sizes.
async-profiler offers accurate low-overhead profiling, but only on Linux or WSL2. A Windows version + IDE integration is available only in IntelliJ Ultimate.