tech-embed archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: file creation decreases memory !



On Tue, Mar 02, 2004 at 11:40:30AM +0530, nmahajan%hss.hns.com@localhost wrote:
> we are observing that the file copied decreases the top shown free memory ?
> and increases the File memory shown by top i.e
> Memory: 50M Act, 72M Inact, 220K Wired, 1944K Exec, 110M File, 96M Free

This means unused memory pages have been used for file buffer cache.

> This goes on even if we issue sync command (wasnt it supposed to write back
> these dirty pages back to disk ?)

The file has been written to disk, but the buffer cache remains to speed up
reading the same file again.

> what happens further is that if say a program asks for memory it goes down
> saying out of swap ??

Memory used by the buffer cache is available to processes.  If you run out
of memory, pages from the buffer cache are allocated for processes.
It's just better to use the unallocated memory for buffering data than
not using it at all.

  -jm



Home | Main Index | Thread Index | Old Index