You are not logged in.
Pages: 1
I'm using some `tmpfs` partitions, the biggest offender being `/tmp`. A problem I've encountered a couple of times is that RAM usage might increase without me noticing.
The problem is that no tools seems to add `tmpfs` usage to used RAM.
Is there a way around this?
Offline
Moving to Kernel & Hardware...
Offline
I believe data in tmpfs is counted (by the kernel) either as cache or swap.
You could perhaps simply monitor the size of tmpfs filesystems with df.
Offline
I believe data in tmpfs is counted (by the kernel) either as cache or swap.
You could perhaps simply monitor the size of tmpfs filesystems with df.
This is far from a problem in the regular case, but if I'm compiling in /tmp it grows quite quickly, and the OS never understands I'm running out of memory to begin swapping.
Offline
Maybe your swappiness is set to 0 or a low value?
I try either not to use tmpfs on /tmp or not to compile in /tmp.
Offline
Maybe your swappiness is set to 0 or a low value?
I try either not to use tmpfs on /tmp or not to compile in /tmp.
I have swappiness of 60, but I have 8GB RAM, so I don't swap often. In fact, I don't think it's swapped at all.
This is the reason why I have /tmp as ramfs too.
If it's not possible to make Linux count tmpfs as RAM usage, I guess I'll just have to be careful if using a tmpfs for something heavy.
I still think it should be possible though.. It's using RAM, so why shouldn't it handle it as such?
Offline
What happens to your PC when you're compiling something big in /tmp?
It normally swaps out stuff that hasn't been touched for a while (with that while getting shorter the greater the memory pressure gets). Non-droppable cache should be seen as used RAM, and stuff from tmpfs should be swapped out if need be. But maybe the kernel doesn't see the need to swap anything (processes) out. And maybe it is unwilling to swap out stuff that is being worked on in tmpfs.
Offline
What happens to your PC when you're compiling something big in /tmp?
It normally swaps out stuff that hasn't been touched for a while (with that while getting shorter the greater the memory pressure gets). Non-droppable cache should be seen as used RAM, and stuff from tmpfs should be swapped out if need be. But maybe the kernel doesn't see the need to swap anything (processes) out. And maybe it is unwilling to swap out stuff that is being worked on in tmpfs.
Doh! I just noticed that what I thought was the issue wasn't! I've set /tmp to 4GB while I have 8GB RAM! So the issue was actually lack of space on the file system.
I probably did this exactly to avoid eating up all the RAM when I set up the system.
The original question still stands, but the "reason" and how I found out about this doesn't hold.
Offline
By default tmpfs filesystems are set to a half of RAM.
Offline
By default tmpfs filesystems are set to a half of RAM.
Thanks, didn't know that. Looking at fstab, there's no indication of any size, and I see the other tmpfs's are 4GB too.
Offline
Have a look at https://www.kernel.org/doc/Documentatio … /tmpfs.txt , if you haven't.
-edit-
If you want to see it swapping indeed, run "mount -o remount,size=90% /tmp", install dstat from the community repo, run "dstat -dmgs", copy whatever big you have to /tmp to fill it, observe dstat's output.
Last edited by lucke (2014-03-27 19:39:13)
Offline
Pages: 1