-
Bug
-
Resolution: Unresolved
-
P3
-
7u80, 8u60, 9
-
linux
The Physical Memory events for JFR on linux are misleading, since it includes cache in the used memory metric.
Example:
What `free` reports as 2936 mb of used memory:
total used free shared buff/cache available
Mem: 15754 2936 5773 210 7044 12327
JFR reports as almost 10 gb of used memory (see attached png), since it also seem to include kernel buffers and cache in "used memory". Since most of the cache can be reclaimed when it is needed it should not be reported as in use.
On newer kernels MemAvailable in /proc/meminfo could be used for a more accurate in use memory value.
Otherwise, free uses: "used Used memory (calculated as total - free - buffers - cache)".
See "man 1 free" for some more info that might be useful.
Example:
What `free` reports as 2936 mb of used memory:
total used free shared buff/cache available
Mem: 15754 2936 5773 210 7044 12327
JFR reports as almost 10 gb of used memory (see attached png), since it also seem to include kernel buffers and cache in "used memory". Since most of the cache can be reclaimed when it is needed it should not be reported as in use.
On newer kernels MemAvailable in /proc/meminfo could be used for a more accurate in use memory value.
Otherwise, free uses: "used Used memory (calculated as total - free - buffers - cache)".
See "man 1 free" for some more info that might be useful.