Use the actual available free memory instead of the max possible
This commit is contained in:
@@ -102,6 +102,21 @@ public class Windows extends OS {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFreeMemory() {
|
||||
try {
|
||||
MEMORYSTATUSEX _memory = new MEMORYSTATUSEX();
|
||||
if (Kernel32.INSTANCE.GlobalMemoryStatusEx(_memory)) {
|
||||
return (int) (_memory.ullAvailPhys.longValue() / 1024); // size in KB
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCUDALib() {
|
||||
return "nvcuda";
|
||||
|
||||
Reference in New Issue
Block a user