Use the right attribut for available memory.
MemFree: The amount of physical RAM, in kilobytes, left unused by the system. MemAvailable: An estimate of how much memory is available for starting new applications, without swapping.
This commit is contained in:
@@ -125,7 +125,7 @@ public class Linux extends OS {
|
|||||||
while (scanner.hasNextLine()) {
|
while (scanner.hasNextLine()) {
|
||||||
String line = scanner.nextLine();
|
String line = scanner.nextLine();
|
||||||
|
|
||||||
if (line.startsWith("MemFree")) {
|
if (line.startsWith("MemAvailable")) {
|
||||||
String buf[] = line.split(":");
|
String buf[] = line.split(":");
|
||||||
if (buf.length > 0) {
|
if (buf.length > 0) {
|
||||||
Integer buf2 = new Integer(buf[1].trim().split(" ")[0]);
|
Integer buf2 = new Integer(buf[1].trim().split(" ")[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user