# GitHub Actions: Error: Process completed with exit code 137 (Killed — out of memory)

**Code:** `Process completed with exit code 137` · **Category:** CI/CD · **Seen on:** GitHub Actions, Linux

The command was killed by the system with SIGKILL (128 + 9), almost always because the runner ran out of memory.

## Meaning

Hosted runners have limited RAM (7 GB on standard Linux). Builds, bundlers (webpack, Gradle), test suites and Docker builds can exceed it. The log often ends with "Killed". Reduce parallelism, raise memory limits for the tool, use a larger runner, or split the work.

## Common causes

- Out of memory during build or tests (webpack, tsc, Gradle, Maven)
- Too many parallel workers/jobs
- Memory leak in a long-running test run
- Docker build using huge layers or parallel stages
- Process killed by a timeout script (`kill -9`)

## Quick fix

1. Lower parallelism (`--maxWorkers=2`, `--jobs 2`)
2. Set the tool's memory limit (`NODE_OPTIONS=--max-old-space-size=4096`)
3. Use a larger runner or split the job

## Detailed fix by platform

### GitHub Actions

1. `env: NODE_OPTIONS: --max-old-space-size=4096` and `run: npm test -- --maxWorkers=2`
2. Add a swap step on Linux runners if needed

### Linux

1. `free -m` and `dmesg | tail` at the end of the job show memory pressure

## Code examples

### Reduce memory pressure

```yaml
- name: Build
  env:
    NODE_OPTIONS: --max-old-space-size=4096
  run: npx tsc --noEmit && npx webpack --mode production
- name: Show memory
  if: always()
  run: free -m
```

## How to diagnose

1. **Tool** — Which step was killed?
2. **Memory** — free -m usage?
3. **Parallelism** — Workers/jobs running at once?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cicd/gha-process-completed-exit-code-137)
