My machine has a physical memory of 16 GB and I can create a ram disk of size 25 GB from this command
sudo mount -t tmpfs -o size=25G tmpfs /tmp/ram4
However as far as I have understood, ram disks write content to the ram. But in this case os allows me to create a ram disk of size more than my physical memory. I have couple of questions
When I create a ram disk, does linux actually allocate same amount of space from the ram or does it grow according to the data which comes to the disk?
Does ram disk only write to the memory or is there a possibility where it writes the content to swap space?