Apply scaling reserved RAM to large runners only

This commit is contained in:
Henry Mercer 2023-07-21 17:35:34 +01:00
parent 18ae9813bf
commit fda93d8ef5
6 changed files with 16 additions and 16 deletions

View file

@ -160,9 +160,9 @@ function getSystemReservedMemoryMegaBytes(
const fixedAmount = 1024 * (platform === "win32" ? 1.5 : 1);
if (isScalingReservedRamEnabled) {
// Reserve an additional 2% of the total memory, since the amount used by
// Reserve an additional 2.5% of the amount of memory above 8 GB, since the amount used by
// the kernel for page tables scales with the size of physical memory.
const scaledAmount = 0.02 * totalMemoryMegaBytes;
const scaledAmount = 0.025 * Math.max(totalMemoryMegaBytes - 8 * 1024, 0);
return fixedAmount + scaledAmount;
} else {
return fixedAmount;