mirror of
https://github.com/github/codeql-action.git
synced 2026-04-13 01:55:49 +00:00
Don't log invalid cgroup memory limits
This commit is contained in:
5
lib/util.js
generated
5
lib/util.js
generated
@@ -189,6 +189,11 @@ function getCgroupMemoryLimitBytes(limitFile, logger) {
|
||||
return undefined;
|
||||
}
|
||||
const displayLimit = `${Math.floor(limit / (1024 * 1024))} MiB`;
|
||||
if (limit > os.totalmem()) {
|
||||
logger.debug(`While resolving RAM, ignored the file ${limitFile} that may contain a cgroup memory limit as ` +
|
||||
`its contents ${displayLimit} were greater than the total amount of system memory.`);
|
||||
return undefined;
|
||||
}
|
||||
if (limit < MINIMUM_CGROUP_MEMORY_LIMIT_BYTES) {
|
||||
logger.info(`While resolving RAM, ignored a cgroup limit of ${displayLimit} in ${limitFile} as it was below ${MINIMUM_CGROUP_MEMORY_LIMIT_BYTES / (1024 * 1024)} MiB.`);
|
||||
return undefined;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user