Overlay: Introduce overlay memory limit constant

This commit is contained in:
Kasper Svendsen
2025-11-27 15:33:22 +01:00
parent 1ffb7dd0c8
commit 2f3bbce9a6
13 changed files with 22 additions and 2 deletions

View File

@@ -60,6 +60,14 @@ const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 20000;
const OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES =
OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1_000_000;
/**
* The minimum memory (in MB) that must be available for CodeQL to perform overlay
* analysis. If CodeQL will be given less memory than this threshold, then the
* action will not perform overlay analysis unless overlay analysis has been
* explicitly enabled via environment variable.
*/
const OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024;
export type RegistryConfigWithCredentials = RegistryConfigNoCredentials & {
// Token to use when downloading packs from this registry.
token: string;
@@ -657,7 +665,7 @@ async function runnerSupportsOverlayAnalysis(
}
const memoryFlagValue = getMemoryFlagValue(ramInput, logger);
if (memoryFlagValue < 5 * 1024) {
if (memoryFlagValue < OVERLAY_MINIMUM_MEMORY_MB) {
logger.info(
`Setting overlay database mode to ${OverlayDatabaseMode.None} ` +
`due to insufficient memory for CodeQL analysis (${memoryFlagValue} MB).`,