nvim-jfr can optionally load project-only run configurations from:
<root>/.jfr/run-configs.lua
Run configs let you name common recording presets (settings, duration, overrides) and select them when starting a recording.
Create <root>/.jfr/run-configs.lua:
return {
-- Optional: which config should be treated as the default.
default = "profile-60s",
-- Required: map of name -> config.
configs = {
["profile-60s"] = {
settings = "profile", -- "default" | "profile" | path to .jfc
duration = "60s",
start_overrides = {
maxsize = "250M",
maxage = "10m",
},
},
["alloc"] = {
settings = ".jfr/templates/alloc.jfc",
duration = "5m",
},
},
}Use:
:JFRStart --run=profile-60sIf you don’t pass --run=... and the file exists, :JFRStart will:
- prompt for JVM
- prompt for run config
If the file sets default = "...", that config is presented first in the picker (best-effort) so it behaves like a default choice across picker backends.
:JFRStart --run=noneThis forces “manual mode” (no run config applied).
Each config supports:
settings:"default" | "profile" | <path-to-.jfc>duration: a string like"60s","5m"start_overrides: a table of extraJFR.startoptions (capability-gated)
Example with overrides:
return {
configs = {
["profile-capped"] = {
settings = "profile",
duration = "60s",
start_overrides = {
maxage = "10m",
maxsize = "250M",
},
},
},
}When settings in a run config is a .jfc file, it must resolve under:
<root>/.jfr/templates/
This keeps run configs portable and project-local.
You can still use any .jfc path manually via:
:JFRStart --settings=/any/path/to/file.jfcWhen a run config is selected:
- CLI args win (e.g.
--duration=...,--settings=...) - then the run config values
- then your
require("nvim-jfr").setup({ ... })defaults
If you pass both CLI overrides and run config overrides, they are merged in the same order:
setup().start_overridesrun-configs.luastart_overrides- CLI overrides (
--opt=...or--key=value)