diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index aa5a9b9d937..ad1f384fa32 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -2860,39 +2860,14 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { #if INCLUDE_JFR -// hwm (high water mark) in K for the VM RSS -static long jfr_rss_hwm_k = -1; - -static void send_resident_set_size_event(ssize_t size, ssize_t peak) { - EventResidentSetSize event; - event.set_size(size * K); - event.set_peak(peak * K); - event.commit(); -} - void os::jfr_report_memory_info() { - os::Linux::accurate_meminfo_t accurate_info; - if (os::Linux::query_accurate_process_memory_info(&accurate_info) && accurate_info.rss != -1) { - // unfortunately the smaps_rollup/accurate_info contains no hwm (high water mark) for RSS - struct rusage ru; - if (getrusage(RUSAGE_SELF, &ru) == 0) { - if (ru.ru_maxrss > jfr_rss_hwm_k) { - jfr_rss_hwm_k = ru.ru_maxrss; - } - } - - // do not allow larger current RSS than hwm - if (accurate_info.rss > jfr_rss_hwm_k) { - jfr_rss_hwm_k = accurate_info.rss; - } - - send_resident_set_size_event(accurate_info.rss, jfr_rss_hwm_k); - return; - } - os::Linux::meminfo_t info; if (os::Linux::query_process_memory_info(&info)) { - send_resident_set_size_event(info.vmrss, info.vmhwm); + // Send the RSS JFR event + EventResidentSetSize event; + event.set_size(info.vmrss * K); + event.set_peak(info.vmhwm * K); + event.commit(); } else { // Log a warning static bool first_warning = true;