0

I am using tmpfs with /tmp directory. However, when i add files, the output of the free -h shows that the cached column value will increase as well.

However, i am wondering that page cache usage info is also added into cached. Does the memory used by files in /tmp directory can be recycled when we lack of memory just like what we do for page cache.

andy
  • 3,951
  • 9
  • 29
  • 40
  • tmpfs is in the pagecache and can be swapped to disk. https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt – Ipor Sircer Oct 26 '16 at 12:17
  • @iporsircer if i close the swap, then can tmpfs memory be recycled when the machine is less of memory. – andy Oct 27 '16 at 07:51

1 Answers1

0

As said in the kernel tmpfs:

size: The limit of allocated bytes for this tmpfs instance. The default is half of your physical RAM without swap. If you oversize your tmpfs instances the machine will deadlock since the OOM handler will not be able to free that memory.

It is clearly said that the tmpfs memory can not be recycled.

andy
  • 3,951
  • 9
  • 29
  • 40