Compute RAM based on free system RAM rather than total system RAM

This commit is contained in:
Henry Mercer
2023-08-15 19:29:07 +01:00
parent 3ecf990cd2
commit 976c11d860
3 changed files with 3 additions and 3 deletions
Generated
+1 -1
View File
@@ -150,7 +150,7 @@ exports.getMemoryFlagValueForPlatform = getMemoryFlagValueForPlatform;
* @returns {number} the amount of RAM to use, in megabytes
*/
function getMemoryFlagValue(userInput, isScalingReservedRamEnabled) {
return getMemoryFlagValueForPlatform(userInput, os.totalmem(), process.platform, isScalingReservedRamEnabled);
return getMemoryFlagValueForPlatform(userInput, os.freemem(), process.platform, isScalingReservedRamEnabled);
}
exports.getMemoryFlagValue = getMemoryFlagValue;
/**
+1 -1
View File
File diff suppressed because one or more lines are too long