Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My laptop running Ubuntu 12.04 has 8GB RAM. I added following record to /etc/fstab

tmpfs  /media/ramdisk  tmpfs   defaults,noatime,mode=1777 0 0

What exactly does it mean? I have tested that I can save 4GB to ram disk at most. Why exactly 4GB? Where did the computer get this number from?

What happens when I don't use that ram disk for a while and when the directory /media/ramdisk is empty? Does it mean that my system can use whole 8GB ram?

And what happens when the system runs out of ram? Will the most rarely used things be moved to swap?

And should I turn off swap if I think my system will never need it? Will turning off the swap make my computer faster? And can I even remove the swap partition? And will the hibernation work correctly then?

share|improve this question
1  
That's at least half a dozen question that you are asking here. Would you please ask them separately? That way people can actually see each question in the overview page which will improve your chance to get an answer quickly. Also, when you do this you will probably see that some of your questions have already been anwered so you don't have to wait. One of them is here –  Erik Dec 7 '12 at 0:44
    
In addition, you could also consider posting future queries like this on Ask Ubuntu. –  WindowsEscapist Dec 7 '12 at 1:00
    
I disagree, none of the questions is actually related to Ubuntu but rather to Linux in general. –  Erik Dec 7 '12 at 1:02

1 Answer 1

tmpfs means that the computer is creating a virtual filesystem in your RAM. By default, the max size is half of your RAM (this stops your computer from swapping, slowing to a crawl).

I believe that RAM (used by tmpfs) is reserved. However, if it is not being used and a program needs more RAM, it will be moved to disk. See this page for more detailed information.

Hibernation will not work if there is no swap partition. However, you can hibernate using a swap file (more involved). For information on hibernating using a swap file instead of a partition, see this question (provided by Erik).

Swap should never be removed unless you are absolutely sure that you will neverhave any memory leaks and overflows - if something starts to take up RAM, swap will allow you to have a couple extra seconds to kill the process before the kernel starts to kill things.

My apologies for the cluttered-looking post.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.