Anonymous memory


Programs very often require memory that is not associated with a file. For example, malloc() may expand the program's data space or the stack might grow by another page. Neither of these actions needs data from a file to satisfy a page fault. For these cases, the only real requirement is a brand-new page that is initialized to zeroes and that can be saved someplace if it has to be paged out. This is known as anonymous memory, since it is not associated with a specific, named, disk file. The kernel will reserve some space in swap to hold the image in case paging out is required at some point. You will often hear anonymous memory loosely referred to as swap space (which is disk space in SunOS 4.x, but not necessarily so in Solaris 2), because that's where it lives.

In the 4.x kernel, a whole collection of routines deals with anonymous memory. These routines do such things as:

  • Reserve space with a call to anon_resv()

  • Find out information about the pages with anon_getpage()

  • Allocate a zero filled page with anon_zero()

  • Remove a reference to a page with anon_decref()

In Solaris 2, anonymous memory is treated like a regular file. A special unnamed vnode is assigned to keep track of all swap space, so that the regular vnode processing code will work on anonymous space. The special anon routines have been removed.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net