Hi Jerry,
Thanks for your answer.
I want to know how much memory the kernel is currently using -- text+data+heap+stack, if possible. I understand that heap and stack can be gleaned by looking at Slab and KernelStack in /proc/meminfo, but I don't know how can I account for the kernel code and other data.
In case you're wondering why the heck I want to know this, I'm trying to estimate how much physical memory I actually need in a system, by comparing memory usage to available memory. Subtracting buffers+cache from free memory gives me how much memory is being used by user processes, without accounting for memory used by the kernel.
Any rules (either hard and fast, or rules of thumb) on how much memory should be free before the system "senses" memory pressure would also help. My goal is to detect memory shortages (long) before the system starts hitting swap space.
Best regards,
Ricardo
2013/4/10 Rafael Aquini <aquini@xxxxxxxxxx>
Take a glance at http://www.halobates.de/memorywaste.pdf as a start-point toOn Tue, Apr 09, 2013 at 10:07:37PM -0300, Ricardo Jose Pfitscher wrote:
> Hello guys,
> I need help with memory management, i have a question: Is there a way
> to find out how much memory is being used by the kernel (preferably
> form userspace)?
> Anything like /proc/meminfo....
> Thank you,
> --
> Ricardo José Pfitscher
understand where the kernel is potentially using memory (the doc is old, and
things might have changed a bit since its publication, but it stills valid as a
study reference). Also, this userland tool might come handy to your studies:
http://www.selenic.com/smem/
Ricardo José Pfitscher