๐ง Memory Tuning for Large Projects
All Early CLI agents generate code and run tests inside a Node.js process.
For large repositories or complex test suites, you may encounter:
FATAL ERROR: Ineffective mark-compacts near heap limit
Allocation failed - JavaScript heap out of memory
To avoid this, tune Node.js memory via the NODE_OPTIONS environment variable.
๐งฎ Recommended Defaultโ
Always set:
export NODE_OPTIONS="--max-old-space-size=5120"
This allocates ~5GB of heap memory โ enough for most monorepos and concurrent processing.
๐ You can set this once in your CI environment or inline per job.
๐งช GitHub Actions Exampleโ
env:
NODE_OPTIONS: "--max-old-space-size=5120"
Set this at the job or step level.
๐งช Jenkins Exampleโ
In your pipeline:
environment {
NODE_OPTIONS = '--max-old-space-size=5120'
}
Or as a shell export before invoking the CLI:
export NODE_OPTIONS="--max-old-space-size=5120"
early generate-pr
๐ Memory Limits per CI Runnerโ
| CI Platform | Recommended Max | Notes |
|---|---|---|
GitHub ubuntu-latest | 6000 MB | Do not exceed --max-old-space-size=6000 |
| Jenkins (medium agent) | 5120โ8192 MB | Based on node resources |
| Self-hosted runners | 8192+ MB | Use higher values with caution |
โ ๏ธ Increasing memory allows more concurrency, but may slow down other jobs if the agent is underprovisioned.
๐ ๏ธ Pro Tipโ
Pair memory tuning with concurrency settings:
export NODE_OPTIONS="--max-old-space-size=5120"
export MAX_CONCURRENCY=4
See Concurrency & Performance for tuning recommendations.
โ Summaryโ
| Variable | Value |
|---|---|
NODE_OPTIONS | --max-old-space-size=5120 |
| Location | CI environment or step |
| Required? | โ ๏ธ Optional, but strongly recommended |