Java on Linux: get the available memory

Viewed 313

I need to check the systems available memory in Java. I am not talking about diskspace our the memory of the JVM. I need the avaliable RAM.

formula for Linux: available = total - free - used - buffered/cached

Posts I found point to

  • com.sun.management.OperatingSystemMXBean: addresses the total and used space but not cache/buffered or used space - so I can not calculate the available space

  • Runtime: addresses the space of the JVM but not the system itself

Any other ideas before I start reading out /proc/meminfo?

Thanks for help!

0 Answers
Related