Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8087325

JFR Physical Memory events include cache in used memory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • 7u80, 8u60, 9
    • hotspot
    • jfr
    • 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.

            Unassigned Unassigned
            aeriksso Andreas Eriksson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: