This is the shortest “happy path” for profiling a JVM with Java Flight Recorder from inside Neovim.
When nvim-jfr detects a project root, it uses these project-local paths:
- Recordings:
<root>/.jfr/recordings/(*.jfr) - Templates:
<root>/.jfr/templates/(*.jfc)
- Start a recording
:JFRStart --settings=profile --duration=60s- Monitor while it runs
:JFRStatus- Stop and save (or dump without stopping)
:JFRStop
" or:
:JFRDump- Browse/manage saved recordings
:JFRRecordings
" delete from the picker:
:JFRRecordings --delete=true:JFRRecordings is also how you open recordings:
- Select a
.jfrto open it. - If
jmc_commandis available, nvim-jfr will open the file in JDK Mission Control. - Otherwise it falls back to your OS “open” handler (e.g.
open/xdg-open).
When you save a recording via :JFRStop or :JFRDump, nvim-jfr writes a sidecar JSON file next to it:
foo.jfr→foo.jfr.json
This captures how the recording was produced (selected run config name, effective settings, overrides, JVM info), using relative paths when possible.
If you delete a recording via :JFRRecordings --delete=true, the sidecar is deleted too.
Stop all recordings for the selected JVM:
:JFRStop --all=true " confirm
:JFRStop! " no confirmation:JFRDump " dumps the latest/only recording (useful with no args)
:JFRDump! " always pick recording(s)
:JFRDump --pick=true " always pick recording(s)If <root>/.jfr/run-configs.lua exists, :JFRStart will prompt for a run config after JVM selection.
:JFRStart --run=profile-60s
:JFRStart --run=none " skip run config selection/applicationSee: docs/run-configs.md
You can pass additional JFR.start options as overrides:
:JFRStart --opt=maxage=10m --opt=maxsize=250M
" or:
:JFRStart --maxage=10m --maxsize=250MUnsupported overrides are ignored (capability-gated) and reported.
Use :JFCNew to copy a template into <root>/.jfr/templates/ and edit it.
Then start a recording with that settings file:
:JFRStart --settings=<root>/.jfr/templates/your.jfc --duration=60sTip: for authoring .jfc (XML), use an XML LSP (e.g. LemMinX) for validation/formatting.