For performance diagnostics, it would be good to expose the VSS/RSS/Swap memory figures for the JVM as periodic JFR stats. We already print the CPU times for the entire system and the JVM process, which allows to attribute how much of the CPU is taken by JVM, and how much the adjacent processes might be taking.
We have system-wide SwapSpace event. It would be nice to have the per-JVM event for swap as well. This would be useful, for example, to clearly see if parts of JVM memory was swapped out.JDK-8307374 added RSS stats already.
There is already a support for this at least on Linux. See how hs_err helpfully prints this:
Process Memory:
Virtual Size: 33767892K (peak: 33820868K)
Resident Set Size: 50204K (peak: 50204K) (anon: 31912K, file: 18292K, shmem: 0K)
Swapped out: 0K
C-Heap outstanding allocations: 103132K, retained: 1103K (may have wrapped)
glibc malloc tunables: (default)
We have system-wide SwapSpace event. It would be nice to have the per-JVM event for swap as well. This would be useful, for example, to clearly see if parts of JVM memory was swapped out.
There is already a support for this at least on Linux. See how hs_err helpfully prints this:
Process Memory:
Virtual Size: 33767892K (peak: 33820868K)
Resident Set Size: 50204K (peak: 50204K) (anon: 31912K, file: 18292K, shmem: 0K)
Swapped out: 0K
C-Heap outstanding allocations: 103132K, retained: 1103K (may have wrapped)
glibc malloc tunables: (default)