hot command produces dual-ranked tables showing the hottest methods in your profile. It’s the go-to command for identifying performance bottlenecks.
Usage
What It Shows
Two ranked tables:- RANK BY SELF TIME - Methods appearing at the top of stacks (doing actual work)
- RANK BY TOTAL TIME - Methods appearing anywhere in stacks (orchestrating work)
- Method name
- SELF% - Percentage of samples where this is the leaf frame
- TOTAL% - Percentage of samples containing this method anywhere
- SAMPLES - Raw sample count for the ranking dimension
Flags
Limit output rows in each table. Controls how many methods are shown.
Show fully-qualified names (full package paths) instead of short names.
Exit with status 1 if the top method’s self% >= threshold. Useful for CI gates to catch performance regressions.Example:
--assert-below 10.0 fails if any method consumes ≥10% self-time.Shared Flags
Event type:
cpu, wall, alloc, lock, or hardware counter name.Filter to threads containing this substring.
Start of time window (JFR only). Examples:
5s, 1m30s, 2m.End of time window (JFR only). Examples:
10s, 2m, 1m30s.Remove idle leaf frames from analysis.
Examples
Basic Usage
Show More Methods
Fully-Qualified Names
Allocation Profiling
CI Performance Gate
Wall-Clock Time for Blocking Analysis
Filter to Specific Threads
Time Window
Remove Idle Frames
Understanding Self vs Total
High Self Time
Method does significant work itself. Target for micro-optimization or algorithm improvement.
High Total Time
Method orchestrates expensive operations. May not need optimization itself, but investigate what it calls.
Low Self, High Total
Wrapper/orchestrator method. Use
tree command to see what it calls.High Self, High Total
Method both does work and calls expensive code. Prime optimization target.
Reading the Output
HashMap.hashappeared at the top of the stack in 8.3% of samples (doing work)- It appeared somewhere in the stack in 12.1% of samples (called by others too)
- It was seen in 998 samples (absolute count)
SELF% measures direct cost. TOTAL% measures direct + indirect cost (including everything this method calls).
When to Use
Finding Bottlenecks
Identify which methods consume the most CPU or allocate the most memory
Before Deep-Dive
Get method names to investigate with
tree, trace, or callers commandsComparing Profiles
Run on multiple profiles to see ranking changes over time
CI Validation
Use
--assert-below to catch performance regressions automatically