Skip to content
Latchkey

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.

lambda
RequestId: 55aa66bb Error: Runtime exited with error: signal: killed
REPORT Duration: 812.44 ms  Memory Size: 128 MB  Max Memory Used: 128 MB

Common 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.

template.yaml
Properties:
  MemorySize: 512

Stream instead of buffering

  1. Check the REPORT Max Memory Used against Memory Size to confirm starvation.
  2. Stream large payloads rather than reading them fully into memory.
  3. 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.

Frequently asked questions

What causes ""Runtime exited with error: signal: killed""?
A 128 MB function loading a large model, dataset, or dependency graph exhausts memory and is killed.
How do I fix "Runtime exited with error: signal: killed"?
Give the function enough memory (which also raises its CPU share) to complete.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card