0

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?

1
  • 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, 2012 at 18:45

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .