// Check if enough memory is available on the system
// args[0] : expected memory size in Kb

// WARNING : works only with Sun JVMs > 1.5

var selected = false;

var osb = java.lang.management.ManagementFactory.getOperatingSystemMXBean();
var mem = osb.getFreePhysicalMemorySize()/1024;
print(mem+" Kb available");
//var swap = osb.getFreeSwapSpaceSize()/1024;
//print(swap+" Kb");
selected=java.lang.Integer.parseInt(mem)>java.lang.Integer.parseInt(args[0]);
print("FreeMem check : "+selected);
// Check if enough memory is available on the system
// args[0] : expected memory size in Kb

// WARNING : works only with Sun JVMs > 1.5

var selected = false;

var osb = java.lang.management.ManagementFactory.getOperatingSystemMXBean();
var mem = java.lang.Math.round(osb.getFreePhysicalMemorySize()/1024);
print(mem+" Kb available");
//var swap = osb.getFreeSwapSpaceSize()/1024;
//print(swap+" Kb");
selected=java.lang.Integer.parseInt(mem)>java.lang.Integer.parseInt(args[0]);
print("FreeMem check : "+selected);
Fix memory selection script in case of weird RAM amount
Fix memory selection script in case of weird RAM amount

If RAM is not a power of 2 then we might have a floating number.

Change-Id: I667444e30f508df0d3d092f6385d2650471c68a3
