Enter your email address:

Delivered by FeedBurner

Swap memory increase with swap file (How to create)


StumbleUpon Toolbar

Swap Memory is a space in the Hard Disk of your computer that Operating Systems (Linux in our case) will use to put the info that is actually on the RAM to free it for another application.

This should be done when the system needs memory for a new process and there is none, so we can see that if our system has plenty of RAM it will maybe need no SWAP memory.

How much Swap Memory do I need?

As a rule of thumb if you have 512 MB RAM put 1 GByte Swap, but this stops being true when the limit at least in x386 PCs is achieved (2 GB or swap is the maximum I could ever allocate to a System).

How do I create Swap.

Usually when you install Linux you reserve a partition to be used as swap memory, and the rest of the disk for your files, but what happens if I need more swap memory?. How to create more swap memory?

If you disk is full you can try to shrink the partitions to make room for another swap partition but an easier way is to make a swap file, so now the question is.

How to create a swap file?

dd if=/dev/zero of=/swapfile bs=1024 count=100000
This will create file (swapfile) of size 100 MB (round)
mkswap /swapfile
add this file to your swap pool
swapon /swapfile

This will do the job, now you have 100 more Mbytes of swap memory.

related notes:
How to manage swap memory
Swap partition vs swap file

Trackback URL for this post:

http://www.go2linux.org/trackback/75
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

swpaon /swpafile Should

swpaon /swpafile

Should be

swapon /swapfile

Thanks!! Change

Thanks!! Change made.

Guillermo Garron

I get "Operation not

I get "Operation not permitted" even signed in as root - then again, I'm in a VPS so maybe it can't be done?

Thanks for this article, I

Thanks for this article, I installed Ubuntu 8.04 on my Fujitsu Siemens V3205 with 2 GB of RAM.

I have no SWAP space right now, I have 15GB free of space! do I need to add SWAP to my system? or 2GB is just fine?

Thanks

Regards

i think it should be

i think it should be OK.

Guillermo Garron

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting