Roughly (because I've never found anything that explains these statistics precisely):
Quote:
Originally Posted by pablopla
what does it means that 1655900 is used by buffer/cache?
|
When an application does ordinary file I/O or it maps files into its address space (which is the usual way of accessing most executable code) the OS may buffer or cache parts of the file in memory to reduce disk I/O.
Yes. Unless you have absurdly more ram than your system has use for, most of the memory that isn't in use directly by applications should be in use by buffer/cache.
Quote:
Will ubuntu automatically decrease the cache if another application needs the memory?
|
Usually. The OS must make a rather complex decision when memory is needed. If the most recent use (only measured approximately) of some buffer/cache memory was less recent than the most recent use of all application memory, then the OS certainly should free some buffer/cache when an application needs memory. That is the typical result in a system with more ram than it really needs. But if some application memory was less recently accessed than any buffer/cache memory, the OS design must balance the probability of reuse being lower for less recently used against it being lower for buffer/cache than for application and it may decide to swap out some application memory rather than free some buffer/cache memory.
Quote:
Can you please explain what are VIRT, RES and SHR when running 'top'?
|
VIRT is the total virtual memory size of the process. It is often misleadingly high because it includes things like demand zero memory, and unaccessed portions of mapped files.
RES is the amount of the process's memory currently physically mapped to actual ram. It might be misleadingly low because I think it excludes pages that could be soft faulted. In obscure cases it could be misleadingly high because pages might be double mapped (I think they would be double counted). In more common cases it will be misleadingly high because of shared (with other processes) mappings. But it is a fairly good measure of the physical ram footprint of a process.
SHR is the amount of a process's virtual memory that is mapped in a way that it could be shared, for example the parts into which unmodified sections of .so files are loaded. But nothing tells you how much of that is actually shared nor how much of it is actually in physical memory.