> For the complete documentation index, see [llms.txt](https://platform9.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform9.com/kb/pmo/how-to/instances-stop-randomly-due-to-out-of-memory-error.md).

# Instances Stop Randomly Due to Out of Memory Error

## Problem

* Multiple instances stop randomly.
* We can see 'Out of memory' errors on the host.
* We can see 'Instance is already powered off in the hypervisor when a stop is called' messages in */var/log/pf9/ostackhost.log* on the host.

{% tabs %}
{% tab title="None" %}

```none
118 WARNING nova.compute.manager [req-f9189bc9-4218-494b-b794-a924fc744210 None None] [instance: baebf3af-6294-4e4c-ab9e-64f5f5ff45d7] Instance shutdown by itself. Calling the stop API. Current vm_state: active, current task_state: None, original DB power_state: 1, current VM power_state: 4798 INFO nova.compute.manager [req-f9189bc9-4218-494b-b794-a924fc744210 None None] [instance: baebf3af-6294-4e4c-ab9e-64f5f5ff45d7] Instance is already powered off in the hypervisor when stop is called.
```

{% endtab %}
{% endtabs %}

* We can see below errors in */var/log/messages.log.*

{% tabs %}
{% tab title="None" %}

```none
smc02e3b01 kernel: Out of memory: Kill process 16752 (qemu-kvm) score 702 or sacrifice childsmc02e3b01 kernel: Killed process 16752 (qemu-kvm) total-vm:30600032kB, anon-rss:24304276kB, file-rss:2000kB, shmem-rss:20kBsmc02e3b01 systemd-machined: Machine qemu-15-baebf3af-6294-4e4c-ab9e-64f5f5ff45d7 terminated
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed OpenStack - All Versions

## Cause

Kernel initiated Out Of Memory Killer (OOM Killer).

OOM Killer is a process that the Linux kernel employs when the system is critically low on memory.

As there is not enough memory on the host, the kernel has initiated the OOM killer which sacrificed the qemu/kvm process and the instances on the host have stopped.

## Resolution

Add more memory on the host or increase swap if physical memory/swap space is low.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://platform9.com/kb/pmo/how-to/instances-stop-randomly-due-to-out-of-memory-error.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
