GitHub Actions github/codeql-action out of disk / OOM
CodeQL builds a database of the codebase and runs heavy analysis queries. On large repos this can exceed the runner disk or memory, causing the extractor to fail or the process to be OOM-killed.
What this error means
A codeql-action analyze (or autobuild) step fails with a disk-full error or the process is killed, often on a large monorepo.
Error: Failed to run query: Out of memory (killed)
Error: No space left on device while creating CodeQL databaseCommon causes
Insufficient memory for analysis
Deep analysis on a large codebase exceeds the runner RAM and the kernel OOM-kills it.
Disk exhausted by the database
The CodeQL database plus build artifacts fill the runner disk.
How to fix it
Reduce footprint or use a larger runner
- Limit languages analyzed and split into multiple jobs.
- Free disk space before analysis or prune the build.
- Run analysis on a larger runner with more RAM/disk.
- uses: github/codeql-action/analyze@v3
with:
category: '/language:javascript'How to prevent it
- Scope CodeQL to the languages you actually ship.
- On Latchkey managed runners you can size up to higher-memory/disk runners for CodeQL, and transient extractor failures are auto-retried rather than red-failing the scan.