What Happens If I Exceed the Memory Limit?
A common question we hear on Support is “What happens if our Gigalixir app(s) goes over the memory limit (replica size) ceiling?”
The quick answer is that when any app exceeds the memory limit, your Kubernetes pod will get OOMKilled (error: OOMKilled—Container Limit Reached) and restarted.
Understanding OOMKilled
OOM stands for "Out of Memory." When a system is in danger of running out of available memory, the OOM Killer will terminate processes to free up resources and prevent a total system crash. This restart isn't always instantaneous, but it is close enough that you should expect it as soon as the limit is breached.
Debugging OOMKilled on Gigalixir
If an OOMKilled event occurs, check your application logs to determine why the pod exceeded the max limit setting. Typical reasons include sudden traffic spikes, large data processing in memory, or long-running Kubernetes jobs.
Prevention & Mitigation
If your app's memory usage is regularly close to the limit, we suggest you scale your replica size appropriately for the upper bound of any expected surge. This prevents unexpected downtime from the pod being killed.
If you are still having trouble debugging the issue, you can always contact us at Support.