On Thursday 30 July 2009 14:17:26 Grant wrote: > OK, that's right. How can I find out if 4GB RAM (the current amount) > is enough? From what I understand of how Linux handles memory, it > will fill it up as quickly as possible, and then free it as necessary. > This makes it difficult to determine how much RAM is necessary from > watching top.
top lies. This has been discussed here many times. All your memory tools essentially tell you how much memory an app is able to see into, and most of that memory is shared with other stuff (like libs). You can't tell how much memory an app is using in any meaningful way, you are not supposed to even look at it as it changes millions of times a second. What you are supposed to do is select an allocation algorithm that works well for you in practice and let the kernel do the heavy lifting. Yes, the kernel does grab as much memory as it can for buffers and cache, then release it on demands. All modern operating systems have done this for many years - Linux just doesn't try and hide that fact from you :-) > I read on this list that the kernel needs *some* swap, even just a > tiny amount, to function properly. Is that true? If so, do you think > it would be OK to put this tiny amount of swap on a cheap SSD? Not true. I have machines with zero swap and they work just fine. I am utterly unconcerned with out of memory conditions as whether you have swap or not, when virtual memory runs out, either way you have a horrible cockup that is hard to fix. Then there's the oom-killer that comes along, stomps all over everything and just makes it worse. -- alan dot mckinnon at gmail dot com