3 ms·
Linux also counts files on tmpfs as part of the cache number--it's really annoying that no number in top can serve to show you a decent approximation of how man
by gue5t 13y ago
Linux also counts files on tmpfs as part of the cache number--it's really annoying that no number in top can serve to show you a decent approximation of how many page-size malloc()s you can do before OOM (with overhead and fragmentation and so on, of course it's infeasible to get an exact number).
- marcosdumay 13y agoIt's worse. No line of /proc/meminfo has that value, and since not all of the cache can be instantly discarded (I didn't know that), I don't see any combination of them that would help. That sentence: > There are no downsides, except for confusing newbies. Just isn't true. There is the downside that we can't know how much memory is available.
- makomk 13y agoYeah, and obviously some (though not all) forms of shared memory are actually implemented using tmpfs behind the scenes which makes life even more interesting. I think the problem I encountered involved SysV shared memory which isn't backed by tmpfs and does show up in /proc/meminfo, whereas other types may not.
- mitchty 13y agoCan't you use something like this: https://raw.github.com/pixelb/ps_mem/master/ps_mem.py https://raw.github.com/pixelb/ps_mem/master/ps_mem.py I use that to help determine "least incorrect" ram usage on linux. It is ok, maybe not perfect but it at least lets you get a better view on memory.