My swapfile isn't used

Posted January 24, 2014 6.3k views
I've created a swapfile but zero swap is being used. $ free -m: total used free shared buffers cached Mem: 490 478 12 0 3 412 -/+ buffers/cache: 62 428 Swap: 511 0 511 $ swapon -s Filename Type Size Used Priority /swapfile file 524284 0 -1 $ vim /etc/fstab: # proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/vda1 during installation UUID=b96601ba-7d51-4c5f-bfe2-63815708aabd / ext4 noatime,errors=remount-ro 0 1 /swapfile none swap sw 0 0 After the (sudo /home/deploy/.rbenv/shims/passenger-install-nginx-module) command, this error shows up: Your compiler failed with the exit status 4. This probably means that it ran out of memory. To solve this problem, try increasing your swap space: What is going wrong? The swap file is configured and available, but isn't used by the installer of passenger-nginx.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers
Try running sudo sysctl vm.swappiness=10—does that fix it?
Wow thank you! But what does this command exactly and why it isn't named in this tutorial ?
by Etel Sverdlov
Linux swaps allow a system to harness more memory than was originally physically available. Here's how to set up a linux swap file on Ubuntu 12.04
@mathijskingma: The article sets vm.swappiness to 0 while the one I posted above sets it to 10.