[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving /tmp to tmpfs makes it useless



Josselin Mouette wrote:
> Files which are written on a regular filesystem stay on memory. This is
> called the buffer cache. Whenever they are not used and/or the system
> needs to reclaim memory, they are trashed.
> Files which are written on a tmpfs stay on memory. Whenever they are not
> used and/or the system needs to reclaim memory, they are swapped.

There is one significant difference though. When you read data back to
memory from swap, the kernel does not remember that it already exists on
disk; when the data is evicted from memory again, it is unnecessarily
rewritten to disk rather than just dropped. Thus, if you do multiple
read iterations through a large set of data (which does not fit in
memory) on tmpfs, each iteration does disk read AND write rather than
just read.



Reply to: