Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to make sure that the memory allocated for a RAM disk never gets paged to a HDD. How can it be done in Ubuntu?

share|improve this question
    
Why would you want to do this? It will likely degrade your overall performance. Modern memory managers are very good about not paging out used memory. Used memory would include any actively used space allocated to the RAM disk, but exclude unallocated space on the RAM disk. –  BillThor Aug 26 '12 at 18:45

1 Answer 1

There are two types of filesystem commonly used for RAM-disks in Linux, ramfs and tmpfs.

tmpfs is the more modern on the two, and will put unneeded files in swap. As far as I am aware, there is no option to disable this.

ramfs is older and more primitive, and cannot use swap. Be warned, however, that unlike tmpfs a ramfs filesystem will continue to grow until you are out of RAM, at which point your system will hard-freeze. Therefore, if you use ramfs, you must be vigilant of its size at all times.

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.