"Cannot allocate memory" when upgrading

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.


https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s1-swap-what-is.html

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

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

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.

4 Likes

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

1 Like