# "Cannot allocate memory" when upgrading

**URL:** https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [5월 11, 2016, 4:23오전 UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029 "2016-05-11T04:23:42Z")
**Posts on this page:** 6
**Page:** 2

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [5월 24, 2016, 6:18오후 UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029/21 "2016-05-24T18:18:46Z")

</div>

Swap does not “take” RAM. Swap adds fake RAM from disk. When apps are out of memory, rather than failing due to being unable to allocate memory, they can use disk as a very slow alternative to memory.

It is the difference between failing completely with `out of memory` and slowing down for a little bit.

> **[Industry](https://www.computerworld.com/industry/)**
>
> Industry | News, analysis, features, how-tos, and videos

[https://www.centos.org/docs/5/html/5.2/Deployment\_Guide/s1-swap-what-is.html](https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s1-swap-what-is.html)

---

<div class="post-metadata">

### Author: ![prateekvarma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/prateekvarma/32/57928_2.png) [@prateekvarma](https://meta.discourse.org/u/prateekvarma)
#### Post date: [5월 24, 2016, 6:50오후 UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029/22 "2016-05-24T18:50:04Z")

</div>

actually, i do see an additional RAM usage on my new relic server monitor. Here is a screenshot. (swap memory is in pink)

 ![](https://global.discourse-cdn.com/meta/original/3X/5/4/54b204baf49322bf6585bdfc518c1bb3b0a6b83d.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [5월 24, 2016, 6:59오후 UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029/23 "2016-05-24T18:59:09Z")

</div>

OK, but that’s totally unrelated to the swapfile change. Please read the above links I cited. Thanks.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [5월 24, 2016, 9:28오후 UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029/24 "2016-05-24T21:28:00Z")

</div>

No, it is related - as there’s more space to work with, the OS can keep more files cached in RAM with sleeping applications swapped out. Which probably improved performance.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [5월 24, 2016, 9:54오후 UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029/25 "2016-05-24T21:54:33Z")

</div>

Yes, but this is only true on a _technicality_ – the total physical amount of RAM in the system is the same.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [6월 8, 2024, 12:45오후 UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029/26 "2024-06-08T12:45:33Z")

</div>

이 주제는 2950일 후 자동으로 닫혔습니다. 더 이상 새로운 답글을 작성할 수 없습니다.

[이전 페이지](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029.md?page=1)
