# "Cannot allocate memory" when upgrading

**URL:** <https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029>\
**Category:** Self-hosting\
**Tags:** server-resources\
**Created:** [May 11, 2016, 4:23am UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029 "2016-05-11T04:23:42Z")\
**Posts on this page:** 1\
**Showing post:** 15

<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:** [May 22, 2016, 8:24pm UTC](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029/15 "2016-05-22T20:24:46Z")

</div>

Hi,  
I have some basic questions about creating a swap file -

1.) since i run a 2GB ram server, what should be the size of the swap that i create, and why?  
2.) How will creating a swap file affect my server? If i create a 1 GB swap, will 1 GB be reserved just for the system processes for Discourse?  
3.) As the forum grows, will i need to increase the size of the swap? What will determine how much should it be increased? And will the method to increase the swap be the same?

Many thanks!

---

_[View the full topic](https://meta.discourse.org/t/cannot-allocate-memory-when-upgrading/44029)._
