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.

I run df -h and found on my Debian Squeeze two tmpfs directory,

tmpfs                 1.5G     0  1.5G   0% /lib/init/rw
tmpfs                 1.5G     0  1.5G   0% /dev/shm

Then, I added a line in my /etc/fstab as following,

tmpfs   /tmp	tmpfs	size=1g		0 0

and I rebooted Debian and found /tmp mounted successfuly.

tmpfs                 1.0G  236K  1.0G   1% /tmp
tmpfs                 1.5G     0  1.5G   0% /lib/init/rw
tmpfs                 1.5G     0  1.5G   0% /dev/shm

My physical memory's size is 3GB. I wonder: Is the three tmpfs either all resided on the memory(Is that possible?) or extended to the swap?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

My physical memory's size is 3GB. I wonder: Is the three tmpfs either all resided on the memory(Is that possible?) or extended to the swap?

tmpfs only uses memory when you fill it with files. So as long as it is empty, it will take almost no space in RAM.

share|improve this answer
add comment

Comprehensive information about tmpfs can be found on IBM DeveloperWorks. In short, tmpfs can use swap as well, whereas ramfs devices are memory only. I recommend you read the DeveloperWorks article when you have time though, it is very detailed, and one of the best articles I've read.

Regarding /dev/shm specifically, it is there for POSIX compliance; Debian is huge on standards compliance. From a Red Hat mailing list post:

/dev/shm is for POSIX compliant shared memory and very few applications even need/use this.

share|improve this answer
2  
PulseAudio will use /dev/shm if present. linux.die.net/man/1/pulseaudio –  nagul Oct 5 '09 at 10:12
add comment

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.