It's not as simple as "used" or "free", memory management is a complex aspect of modern operating systems.. a portion of physical memory is reserved for the kernel, and some memory is used for various system caches, like VFS/block caches, and network buffers.
Modern memory management works on the concept of "pages", and "virtual memory", pages being small chuck of memory, which are mapped into a processes memory space.. these pages don't have to be in physical memory and can be temporarily placed on secondary storage (..disk swap) and the released memory can be allocated by another process or even used for caches.
It's very complicated, but, you can either trust that the kernel is managing your memory in the best way possible.. or.. read the source, as jggimi suggests.
|