AWS Lambda "Runtime exited with error: signal: killed" (out of memory) in CI
The function used more memory than its MemorySize allows, so the runtime killed the process with SIGKILL. The log line reads "Runtime exited with error: signal: killed" and the REPORT shows Max Memory Used at the limit.
What this error means
An invoke fails with "Error: Runtime exited with error: signal: killed" and the REPORT line shows "Max Memory Used" equal to "Memory Size". The function is starved, not crashing on logic.
RequestId: 55aa66bb Error: Runtime exited with error: signal: killed
REPORT Duration: 812.44 ms Memory Size: 128 MB Max Memory Used: 128 MBCommon causes
MemorySize is too low for the workload
A 128 MB function loading a large model, dataset, or dependency graph exhausts memory and is killed.
A memory leak or unbounded buffer
The handler accumulates data in memory across the request (reading a whole file, building a giant array) past the configured limit.
How to fix it
Raise MemorySize
Give the function enough memory (which also raises its CPU share) to complete.
Properties:
MemorySize: 512Stream instead of buffering
- Check the REPORT Max Memory Used against Memory Size to confirm starvation.
- Stream large payloads rather than reading them fully into memory.
- Release large objects between steps so they can be collected.
How to prevent it
- Size MemorySize from observed Max Memory Used plus headroom.
- Stream large inputs and outputs rather than buffering.
- Watch for leaks across warm invocations in load tests.