8315128: jdk/jfr/event/runtime/TestResidentSetSizeEvent.java fails with "The size should be less than or equal to peak"

Reviewed-by: stefank, mgronlun
This commit is contained in:
Erik Gahlin 2023-12-04 16:37:33 +00:00
parent d2c529cc37
commit a9de5c7f13

View File

@ -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