Respect scaling_reserved_ram feature flag by nickrolfe · Pull Request #1760 · github/codeql-action (original) (raw)
The amount of RAM given to the CodeQL evaluator is the machine's total memory size, minus a reserved amount.
Currently, the reserved amount is fixed at 1 GB (or 1.5 GB on Windows). When the scaling_reserved_ram feature flag is enabled, we also add 2% of the total memory size to the reserved amount. This allows for the fact that the kernel will consume more RAM (e.g. for page tables) on machines with more physical RAM, so we should see fewer analyses getting killed by the OOM killer.
N.B. This is my first time working on the Action, or even writing TypeScript. I hope my uses of async/await make sense.