Thread: free memory
View Single Post
  #6   (View Single Post)  
Old 7th July 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

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.
Reply With Quote