/jfr
< Commands
This feature is exclusive to Java Edition.
/jfr| Permission level required |
4 |
|---|---|
| Restrictions |
None |
{
"title": "<code>/jfr</code>",
"rows": [
{
"field": "4",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "None",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Starts and stops profiling with Java Flight Recorder (JEP) as well as a few custom events.
Usage
When profiling, it records several information about CPU, memory, and threads usage of the client while it was running, and saves them on a .jfr file under the .minecraft/debug folder.
The file can be opened using an external tool or software, such as VisualVM or JMC. It contains JVM and operating system events, with several Minecraft-related custom events below:
- Network group, which contains:
- Network Packet Received and Network Packet Sent: network packet events, containing information about their protocol ID, packet ID, packet direction (server or client bound), remote address, and bytes size. See Java Edition protocol for list of protocol and packet IDs.
- Network Summary: summary information of received and sent packets count and their bytes size.
- Storage group, which contains:
- Region File Read and Region File Write: region file events, containing information about region and chunk positions, dimension, and type of compression algorithm.
- Ticking group, which only contains a single custom event:
- Server Tick Time: sampling event of the average server tick duration at one second intervals.
- World Generation group, which contains:
The .jfr file is accompanied by a summary JSON report is written both to the log file and in the debug folder.
Syntax
jfr start- Start JFR profiling.
jfr stop- Stop JFR profiling.
Result
| Command | Trigger | Java Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable |
/jfr start | A jfr profiler has already been started. | Failed |
/jfr stop | There's no jfr profiler running. | |
| Any | Otherwise | Successful |
Output
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | N/A | 0 | 0 |
| On success | N/A | 1 | 1 |
History
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.18 | 21w37a | Added /jfr. | |||||