diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index fc8e0da1a69..18f3cd2b38d 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -2540,7 +2540,9 @@ void os::jfr_report_memory_info() { // Send the RSS JFR event EventResidentSetSize event; event.set_size(info.resident_size); - event.set_peak(info.resident_size_max); + // We've seen that resident_size_max sometimes trails resident_size with one page. + // Make sure we always report size <= peak + event.set_peak(MAX2(info.resident_size_max, info.resident_size)); event.commit(); } else { // Log a warning