Want to add swap partition

1.3k Views Asked by At

I wanted to add swap partition in my Ubuntu 15.10 Using dual boot with windows XP, & Building Cyanogenmod 13 with Linux but always getting error as following,

make:*fork:*Cannot allocate memory

which is related to RAM I have searched & found that need to add swap memory in my Ubuntu, some one is suggested is you need at least 4GB RAM (I have) + 4GB swap partition to continue build. about my computer while checked & found that there is already have swap partition or anything else like attached picture, swap partition details but now confused that what can help me to continue my build does anyone have solution for this

2

There are 2 best solutions below

0
Konstantin Ivanov On

Just continue doing what you started make swap partition or a file. On the picture you already have a swap file, but it's a bit small for your task (256M) just add another one there could be many.

if you are not very familiar with partitioning - making swap file will be less dangerous. You could make one more swap file like this

sudo dd if=/dev/zero of=/path_to_your_swap_file_to_be/swap_file bs=1M count=1024 this will create 1 gig file, if you need 4gigs and your system support so much use 4M blocks or 4096 count.

sudo mkswap /path_to_your_swap_file_to_be/swap_file this will place swap header into file

sudo swapon /path_to_your_swap_file_to_be/swap_file this will add the file to a swap space

free- m now you should see your swap memory pool extended

2
Andrzey On

Add this line:

/path_to_your_swap_file_to_be/swap_file swap swap defaults 0 0

to file /etc/fstab too. Without this, your swap file will disappear after reboot.