mirror of
https://github.com/github/codeql-action.git
synced 2026-10-31 09:59:43 +00:00
Apply scaling reserved RAM to large runners only
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user