tmpfs is a special file system used in
Linux. Not like other traditional disk/partition based file systems, it store’s
the file in memory. So it is much quicker than normal file system.
Then how can we use tmpfs? Well, we will
just mount it as below:
#mount 
 tmpfs 
Usually we can just add a size parameter to
set the maximane size as
we can do some test to write a 50M  file there, then we can check the used
memory increased, then we delete the file and the memory is freed
root@mysql:~# free -m
            
total       used       free    
shared    buffers     cached
Mem:          7985        290       7694          0         17        115
-/+ buffers/cache:        156       7828
Swap:         8187          0       8187
root@mysql:~# dd if=/dev/zero
of=/var/tmp/zero.txt count=100000
100000+0 records in
100000+0 records out
51200000 bytes (51 MB) copied, 0.198847 s,
257 MB/s
root@mysql:~# free -m
            
total       used       free    
shared    buffers     cached
Mem:          7985        339       7646         49         17        164
-/+ buffers/cache:        156       7828
Swap:         8187          0       8187
root@mysql:~# rm /var/tmp/zero.txt
root@mysql:~# free -m
            
total       used       free    
shared    buffers     cached
Mem:          7985        290       7694          0         17        115
-/+ buffers/cache:        157       7827
Swap:         8187          0 
     8187
 
