Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I read about tmpfs and got curious to get the benefits from it. So, I created a directory and mounted as tmpfs.

So, as per theory, whatever is written in tmpfs gets stored on RAM directly and lasts till reboot. So, I created a 10 GB of file on tmpfs drive. As per theory, htop/top command must show RAM consumption to be more than 10 GB. I have 256 GB of RAM, but my RAM consumption was less and same as it was before creation of 10 GB of file on tmpfs.

Is there something that I missed out?

share|improve this question
    
What about the free command? –  muru Dec 28 '14 at 18:29
1  
Possibly you dropped 10gbs cache when caching the new 10gb file? Also - what's in the 10gb file - \0s? That wouldn't consume any memory - /tmpfs understands file holes. –  mikeserv Dec 28 '14 at 18:29
1  
@muru - fancy meeting you here... –  mikeserv Dec 28 '14 at 18:32
    
I just tested the creation of a 4GB file in tmpfs (populated form /dev/zero) and my free memory jumped by 4GB after I deleted it. It seems to have itemized it as cached data so if you're looking at the +/- buffers/cache line it won't change. –  Bratchley Dec 28 '14 at 18:32
1  
Ah I forgot he was asking about htop specifically. Just checked on my system and it's showing memory used sans cache so that's probably the issue. The htop metric doesn't account for the area it's actually storing the file data in. –  Bratchley Dec 28 '14 at 18:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.