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

os::available_memory() on MacOS underreports available memory

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 24
    • hotspot

      On MacOS, os::available_memory() is implemented as "return free space". That number is way too low to give any indication of how much memory we can use. Looks like MacOS grabs most of the memory unused by applications for internal use, but seems to give it back willingly in case of needs.

      Example: On my 32G macbook, istat shows me free memory of ~9G, but os::available_memory seems to constantly hover around 100..300MB.

      We need a metric closer to the logic on Linux.

            Unassigned Unassigned
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: