I have a server with 256GB of ram and I want to create a ram disk, with let's say a 224GB size. Now, I know that there are two main types for ramdisk - ramfs & tmpfs (taken from here):
ramfs file systems cannot be limited in size like a disk base file system which is limited by it’s capacity. ramfs will continue using memory storage until the system runs out of RAM .
tmpfs is a more recent RAM file system - You can specify a size limit in tmpfs which will give a ‘disk full’ error when the limit is reached.
As it seems, tmpfs is the way to go. But after creating the ramdisk using:
> mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk
I noticed that 224GB ram is not actually guaranteed for the ramdisk (free -g gives 256GB free memory without cache)
So, from what I understand tmpfs gives a "barrier" for maximum ram to be used (224GB in my case), but it doesn't guarantee that memory for the ramdisk.
How do I prevent other applications from accessing my ram (the 224GB portion). I don't want a get to a scenario where instead of saving to my ramdisk, I am saving to swap.
=========== Update =============
I found this . It looks a bit "old school", but it could be a solution to my problem.