start_profiling
Initiate JFR profiling on a Java process to capture performance data. Specify PID, duration, and optional preset or custom settings file.
Instructions
Starts JFR on the target PID. Rotates recordings (old_profile.jfr ← new_profile.jfr). Default preset is profile. Optional preset or settingsFile (.jfc, cwd-relative or absolute)—mutually exclusive. Builtin presets may omit socket/I/O/native/locks; use a custom .jfc for jdk.SocketRead/Write, FileRead/Write, JavaMonitorBlocked, jdk.ThreadPark, NativeMethodSample. Then list_jfr_recordings and stop_profiling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | Process ID of the Java application. Use list_java_processes. | |
| duration | Yes | Recording duration in seconds. Typical: 10–60 quick, 300+ under load. | |
| memorysize | No | JFR buffer size, e.g. 20M. Default JVM buffer applies if omitted. | |
| stackdepth | No | Stack depth for JFR events. Default 128. | |
| preset | No | Builtin settings name (e.g. profile, default). Effective default when omitted is profile. Mutually exclusive with settingsFile. | |
| settingsFile | No | Path to .jfc file (cwd-relative or absolute). Mutually exclusive with preset. |