> 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/pmk/solutions/pods-failing-with--cannot-allocate-memory--error.md).

# Pods Failing with "cannot allocate memory" Error

## Problem

Pods failing with "cannot allocate memory" error.

## Environment

* Platform9 Managed Kubernetes - All Versions
* CentOS Linux 7

## Answer

* Error Observed

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

```bash
Mar  3 17:26:11 kubernetes-worker02 kubelet: E0303 17:26:11.092988   23949 pod_workers.go:191] Error syncing pod 00c8233c-8a81-487b-b5be-3f9befc13771 ("test(00c8233c-8a81-487b-b5be-3f9befc13771)"), skipping: failed to ensure that the pod: 00c8233c-8a81-487b-b5be-3f9befc13771 cgroups exist and are correctly applied: failed to create container for [kubepods burstable pod00c8233c-8a81-487b-b5be-3f9befc13771] : mkdir /sys/fs/cgroup/memory/kubepods/burstable/pod00c8233c-8a81-487b-b5be-3f9befc13771: cannot allocate memory
```

{% endtab %}
{% endtabs %}

* Following is the upstream issue link regarding this behavior [Docker fails to start containers with cgroup memory allocation error](https://github.com/docker/for-linux/issues/841).
* Indicates that the fix for the issue [\[LLNL 7.5 Bug\] slab leak causing a crash when using kmem control group](https://bugzilla.redhat.com/show_bug.cgi?id=1507149) should be in Kernel Version `3.10.0-1062.4.1 or later`.
* However the discussion also talks about similar issues being present/reported on Kernel version above this.

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

```bash
$ uname -r
3.10.0-1160.36.2.el7.x86_64
```

{% endtab %}
{% endtabs %}

* One of the temporary workaround mentioned is to add the parameter `cgroup.memory=nokmem` to the `GRUB_CMDLINE_LINUX` line in the configuration file `/etc/default/grub`. After that,

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

```bash
$ grub2-mkconfig -o /boot/grub2/grub.cfg
$ reboot
```

{% endtab %}
{% endtabs %}

Long term solution can be to upgrade the Kernel version to the latest version and see if it resolves the issue OR contact the OS vendor for further assistance.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://platform9.com/kb/pmk/solutions/pods-failing-with--cannot-allocate-memory--error.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
