A cloud VM OOM is not, by itself, a reason to add memory or migrate: first establish whether the kill came from host-wide pressure, a process or container limit, or application behavior. Consider a dedicated server only if capacity is genuinely insufficient, demand is predictable, and your team can take responsibility for operating and recovering the system.
This is for Linux operators investigating a service or container restart, technical leads choosing between application work and cloud scaling, and budget owners assessing whether steady workloads justify a different hosting model.
Today, preserve logs and align their timestamps; before changing limits or capacity, identify the mechanism; this week, compare the same workload against a documented recovery and cost plan.
Start cloud VM OOM troubleshooting with the event, not a memory screenshot
An OOM diagnosis begins with the event that caused the incident. A memory graph captured after a restart or after traffic has fallen may not represent the conditions at the time of the kill. Record the incident time, the affected service or container, customer impact, and any related latency or queue alerts before changing the system.
Check kernel messages and the service’s own record for the same period. Depending on the system, commands to check include journalctl -k and journalctl -u <service>. For a container, also preserve its runtime or orchestration events. A cloud provider’s instance troubleshooting guide likewise treats operating-system logs and instance symptoms as evidence to examine, rather than treating a memory dashboard alone as a diagnosis (instance troubleshooting guidance).
Separate these outcomes:
- The whole VM became unresponsive. Look for host-wide memory pressure, kernel OOM records, and other resource or I/O symptoms around the same time.
- One service exited while the host remained reachable. Check that service’s logs and its systemd or cgroup resource settings.
- A container restarted. Compare its runtime event with the container’s cgroup counters and configured memory limit.
- The application returned errors without a process kill. Investigate application-level limits, request sizes, worker counts, and any internal memory-management behavior.
A useful incident record includes the start and end of the impact, the kernel OOM message if present, the service or container identity, recent deployments or traffic changes, resource limits, and business metrics. If the VM is now healthy, say so in the record; do not treat the new reading as proof of what happened during the failure.
Use the right level of memory evidence
Host-level memory, service-level limits, and application behavior answer different questions. A process can be killed even when the host still has available memory if its cgroup limit has been reached. Conversely, a high “used” reading can include reclaimable cache rather than an immediate shortage.
| Evidence | What it can tell you | What it cannot prove on its own |
|---|---|---|
/proc/meminfo, especially MemAvailable |
The kernel’s estimate of memory available for new work without swapping, including reclaimable memory (proc_meminfo reference) |
Whether a particular service has reached its own limit |
cgroup memory.current, memory.max, and memory.events |
Current cgroup use, its configured maximum, and recorded limit or OOM events, as described in the Linux cgroup v2 documentation | Whether the application has a leak or whether its limit is appropriate |
systemd MemoryHigh and MemoryMax |
Whether the service has a memory pressure control or a hard maximum; systemd documents these as different controls (resource control settings) | Whether raising a limit is safe for the other services on the VM |
| PSI memory data | Time spent under memory pressure, with pressure information exposed through the Linux interface (kernel PSI documentation) | The root cause of the pressure or the capacity needed to resolve it |
Start with grep -E 'MemAvailable|MemFree|SwapTotal|SwapFree' /proc/meminfo. Treat MemAvailable as a useful host-level estimate, not a verdict. If swap is configured, check whether its use is actively changing during the incident and compare that with latency and application behavior. Swap occupancy alone does not establish that an OOM event was caused by insufficient physical memory.
For a systemd-managed service, inspect its effective resource settings with systemctl show <service> -p MemoryCurrent -p MemoryHigh -p MemoryMax. Then locate the service’s cgroup and read its available memory counters, including memory.events where supported. The kernel documentation explains the cgroup controls and event files; confirm the paths and behavior for the system’s actual cgroup version rather than assuming every distribution exposes an identical layout.
Do not infer a root cause from a process exit code alone. Pair the exit or restart record with kernel messages, cgroup events, and service logs. A cloud platform’s OOM troubleshooting notes and a container platform’s OOM guidance are useful cross-checks for interpreting those separate evidence sources (Linux high-memory troubleshooting, container OOM event guidance).
A restart is a clue, not a diagnosis
Consider a small API service that begins restarting during a scheduled report run. The VM’s memory graph still appears to have headroom after the restart, and another service continues responding. That pattern could point to a cgroup cap, a burst in report-worker memory, or an application defect; it does not settle which one occurred.
In this case, the operator should line up the report start time, service restart, kernel log, cgroup event counters, and request or queue metrics. If the cgroup’s event record changes at the same time and the service is near its configured maximum, the limit deserves investigation. If there is no corresponding limit event but process memory rises across repeated runs, application growth deserves closer review. If the whole host shows pressure, capacity and competing workloads need attention.
The point is to test competing explanations with evidence. A single reading taken after the scheduled task ends can miss a short-lived peak, while a restart may reset useful process-level observations. Preserve logs and monitoring before restarting or changing limits whenever the service’s recovery procedure allows it.
First fix the cause you can verify
Use the incident evidence to choose a low-risk next step. Change one relevant factor at a time, then compare the same workload and business measures—such as request latency, errors, queue depth, and restart behavior—before and after the change.
- Check for a recent change. Compare deployment, configuration, traffic, and scheduled-job times with the OOM record. If the problem began after a release, test the relevant change in a controlled way before increasing capacity.
- Review application growth. Look for a process whose memory use rises during a repeatable task or remains elevated after the task ends. Check application logs and worker behavior; a host-level graph may not isolate the responsible process.
- Verify service and container limits. Compare effective limits with observed demand. If a limit is too restrictive, change it only after checking what else shares the host and whether the available memory can safely support the increase.
- Assess the whole VM. Compare
MemAvailable, swap activity, PSI, and kernel records with the incident timeline. Look for recurring pressure under normal production work, not just a brief peak in an unrelated test. - Choose a change and define a rollback. Fix a confirmed application issue, revise a verified local limit, or scale the cloud VM when sustained host demand justifies it. Record what would trigger a rollback before applying the change.
- Repeat the same test. Use comparable traffic or workload conditions and the same service metrics. If the OOM returns, preserve the new evidence instead of repeating an unverified capacity change.
Cloud troubleshooting documentation also recommends investigating high memory usage through system-level evidence and processes, rather than treating one utilization reading as a complete explanation (high-memory troubleshooting steps). The practical distinction is between correcting a cause and masking it: adding memory can postpone a recurrence, but it may not resolve an application leak or a limit that remains in place.
Choose the next route by condition
Use this decision list after collecting the event record. If a condition is uncertain, gather more evidence before committing to a migration.
- If a service or container reaches a configured limit while the host remains healthy, first investigate whether the limit matches expected demand. Adjust it only if the rest of the host has room; otherwise, redesign the workload or scale its environment.
- If application memory grows in a repeatable way, investigate the application, deployment, or job pattern before moving it. A larger machine can defer the same failure without fixing its cause.
- If the whole host shows recurring pressure during normal, predictable work, compare cloud scaling with a dedicated-server assessment. Include ongoing maintenance and recovery responsibilities in that comparison.
- If demand is sharp, irregular, or hard to forecast, prefer a cloud approach that can respond to those changes, or keep the burst-sensitive component there in a hybrid design.
- If the workload depends deeply on managed databases, queues, or serverless services, account for the cost and operational work of replacing or retaining those dependencies before considering a move.
- If your team cannot monitor, patch, back up, and restore a self-managed system, do not treat dedicated hardware as a like-for-like replacement for managed cloud services.
A stable workload can be a candidate for dedicated capacity, but stability does not make a single server highly available. Before a move, decide who monitors it, how data is protected off-host, how restoration is tested, and what happens if the hardware or operating system fails. For a separate view of stable-workload migration factors, see the cloud architecture migration assessment. For recovery planning, review the backup and restore migration guide.
Compare repair, scaling, and migration on one record
A decision is easier to defend when each route uses the same workload assumptions and includes the operational consequences. The table below is a comparison framework, not a price quote: fill in current costs from the applicable provider and RunnerAMD product information, and use measured demand rather than a guessed memory target.
| Route | Good fit when | Cost and work to include | Evidence that would change the decision |
|---|---|---|---|
| Repair the application or job | Logs or repeatable tests point to a defect, unbounded growth, or an avoidable workload peak | Engineering time, testing, deployment, and rollback preparation | OOM events continue after the suspected cause is corrected |
| Adjust a service or container limit | A local limit is confirmed as the trigger and host capacity can safely support a change | Risk to co-located services, monitoring, and retesting | Host pressure appears or other services become unstable |
| Scale the cloud VM | Host-wide demand is sustained, measured, and cloud scaling fits the workload’s elasticity needs | Compute, memory, storage, network, and any associated service charges; verify current pricing for the selected region and configuration | Demand becomes steady enough to justify comparing a different operating model |
| Assess a dedicated server | Memory needs are predictable and the team can own system operations and recovery | Rental, migration, backups, monitoring, maintenance, and recovery work; confirm actual configuration and billing terms before budgeting | Traffic becomes bursty, dependencies require managed services, or the operating burden exceeds the benefit |
A useful comparison records the incident pattern, measured peak demand, current service limits, the proposed target environment, migration effort, monthly cost components, test conditions, and who owns recovery. Include both the expected operating case and a failure case. A migration plan that compares only memory capacity and monthly rental omits the work that determines whether the new environment is manageable.
If a migration remains plausible, set acceptance conditions before moving production traffic. Examples include a representative workload completing without an OOM event, expected service latency and error behavior remaining within the team’s own operating targets, and a tested procedure for returning traffic to the existing environment. The targets must come from the application’s requirements; there is no universal memory threshold that makes a move safe.
Questions operators ask after an OOM event
How can repeated OOM kills be separated from an undersized VM?
Match each kill to kernel logs, service or container events, and application logs. Then compare host-level MemAvailable and pressure information with the affected process’s cgroup limits and counters. Repeated kills are a reason to investigate, not proof that the VM lacks memory. A local limit, an application leak, or a short workload peak can produce the same visible symptom.
Why can a process be killed while Linux still reports available memory?
The reported value may be host-level while the process is constrained by a cgroup or service limit. Linux also uses memory for reclaimable cache, so a “used” or “free” figure alone does not explain what the process can access. Check the effective limit, cgroup events, kernel log, and pressure data together before raising the VM size.
What should be checked when a container OOMs but its host has headroom?
Inspect the container’s effective memory limit and relevant cgroup counters, including memory.current, memory.max, and memory.events when available. Align those records with the container runtime or orchestrator event and the application log. Host headroom does not override a container cap. Change the limit only after checking the needs of other workloads on the same VM.
Should memory be added before investigating the application?
Preserve the failure evidence first. Check whether the event aligns with a hard limit, sustained host pressure, a recent release, or repeatable application growth. If the application or workload is the likely cause, test a targeted correction. If normal production demand repeatedly exceeds host capacity after those checks, compare scaling options and define a rollback before changing the environment.
Which workloads are suitable for a dedicated-server assessment?
A steady, measurable workload is a more credible candidate than one with unpredictable bursts, especially when the team can manage patching, monitoring, backups, and restoration. Keep cloud capacity or use a hybrid design when fast elasticity or managed services are central to the application. Compare the total operating responsibility and dependency changes, not just the available memory.
If the evidence points to a persistent capacity requirement, compare the current cloud setup with RunnerAMD’s actual machine options, operating-system choices, and billing periods before deciding whether to migrate. A dedicated server may suit a stable workload when your team can own its recovery and maintenance; it is not the right replacement if you need rapid elasticity or rely on managed services. Check the current RunnerAMD server options against the measured workload, then keep the cloud plan if its flexibility better fits the evidence.
Frequently asked questions
If my cloud VM keeps killing processes, how can I tell whether it needs more memory?
Start by matching each kill to kernel logs, service or container events, and the application’s own logs. Then compare host-level MemAvailable and memory pressure with the affected process’s cgroup limits and counters. Repeated kills alone do not prove the VM is undersized: a local limit, a leak, or a workload spike can produce the same symptom.
Why can Linux kill a process when the memory dashboard still shows available RAM?
The dashboard may show host-level memory, while the process is constrained by a cgroup or service limit. Linux also uses memory for reclaimable cache, so a single free-memory figure does not describe the full situation. Check the process’s actual cgroup, memory.events, service limits, kernel log, and pressure signals before concluding that the host has spare capacity.
What should I check when a container reports OOM but the VM has memory left?
Inspect the container’s effective memory limit and its cgroup memory.current, memory.max, and memory.events values. Confirm whether the event was recorded for that container and whether an orchestrator restarted it. Host-level headroom cannot override a container limit. If the limit is intentional, adjust it only after checking workload demand and the memory available to neighboring services.
After an OOM event, should I add memory first or investigate the application?
Preserve logs and timestamps first, then check whether the event came from a hard resource limit, sustained host pressure, or application growth. If a repeatable leak or oversized workload is visible, fix or constrain it and retest with the same traffic and latency measures. Increase capacity when evidence shows a genuine, recurring demand that remains after those checks.
Which workloads are reasonable candidates to move from a cloud VM to a dedicated server?
Consider a move when demand is steady and measurable, capacity needs can be planned, and your team can own operating-system maintenance, monitoring, backups, and recovery. Keep burst-heavy services or systems tightly coupled to managed databases, queues, or serverless components in the cloud unless you have a tested hybrid design. Compare total operating responsibility, not just memory size.
Further reading
Give Memory-Hungry Workloads Dedicated Headroom
Compare your peak memory needs with RunnerAMD’s 128GB and 256GB dedicated server configurations before planning a migration.