Xref: utzoo comp.sys.next:16129 comp.arch:22165 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!att!linac!mp.cs.niu.edu!bennett From: bennett@mp.cs.niu.edu (Scott Bennett) Newsgroups: comp.sys.next,comp.arch Subject: Re: Lost pages in swapfile ? Keywords: NeXT, swapfile Message-ID: <1991Apr22.041441.19381@mp.cs.niu.edu> Date: 22 Apr 91 04:14:41 GMT References: <1991Apr15.153504.39750@slate.mines.colorado.edu> Organization: Northern Illinois University Lines: 89 In article <1991Apr15.153504.39750@slate.mines.colorado.edu> mfriedel@slate.mines.colorado.edu (Friedel Michael) writes: >After I boot my NeXTstation I typed vm_stat which is supposed to list >the status of the virtual memory. Here is the result: > >Mach Virtual Memory Statistics: (page size of 8192 bytes) >Pages free: 62. >Pages active: 263. >Pages inactive: 970. >Pages wired down: 133. >"Translation faults": 9249. >Pages copy-on-write: 1970. >Pages zero filled: 954. >Pages reactivated: 3767. >Pageins: 792. >Pageouts: 77. >Object cache: 953 hits of 1116 lookups (85% hit rate) > >My system is 12meg (of which 11 meg are available, 1meg is reserved >by the system at boot time for buffers, so it tells me). >The swapfile has a size of 20971520 bytes after the machine is done >booting. Now no matter how I twist my math, I can't come up with >enough pages that justify a 20meg swapfile. You probably have lowat=20971520 either in /etc/swaptab or /etc/rc.swap (or wherever.) That means that once your swapping/paging area has grown to at least 20MB, it will never shrink to less than 20MB. If you start up several NeXTStep applications, the swapping/paging area can *easily* grow beyond 20MB. NeXTStep apps are not small. Some apps also tend to grow while they run. Try watching how big Mathematica is from time to time during one execution. >So does anyone know to do the correct math, does vm_stat list incorrect >statistics or does the system just forget about a few pages ? > No. The problem here is a literacy problem on the part of the author(s) of vm_stat. Data General is similarly illiterate w.r.t. their AOS/VS system and probably many other vendors' software teams would also fit the bill. The confusion arising from vm_stat's output is the failure to distinguish between "pages", which are the contents of a process's address space, and "page frames", which are blocks of physical memory into which pages are placed for use. A page can be "fixed" or "wired" (depending on your dialect:-) into a page frame, which prevents the page from being paged out to free the page frame that it occupies. So, the first line of data should be Page frames free: 62. The next two lines refer to the *usage* of pages, but only of pages currently in physical memory, i.e. in page frames. I suppose one could argue that they could be labeled validly as they are, but since they can be added together along with number of free page frames to get the number of page frames in your computer, I'd like to see them labeled as shown below. Note also that they do *not* provide similar information regarding the total number of *pages* in the system, which can change from moment to moment. The number of page *frames* in the system is number of 8KB blocks left over in your hardware after the kernel has grabbed everything that it needs for permanently resident stuff. Page frames active: 263. Page frames inactive: 970. This next one *is* correctly labeled, because it refers to the *pages*, though obviously a "wired down" page is in physical memory and must therefore be tying up a page frame. Note that a page frame is a fixed and permanent object (until the next boot, at least) and thus cannot be wired or unwired because it is space, not data, and can't go anywhere anyway. Pages wired down: 133. The remainder of the vm_stat output appears to be correctly labeled. Scott Bennett, Comm. ASMELG, CFIAG Systems Programming Northern Illinois University DeKalb, Illinois 60115 ********************************************************************** * Internet: bennett@cs.niu.edu * * BITNET: A01SJB1@NIU * *--------------------------------------------------------------------* * "Spent a little time on the mountain, Spent a little time on the * * Hill, The things that went down you don't understand, But I * * think in time you will." Oakland, 19 Feb. 1991, first time * * since 25 Sept. 1970!!! Yippee!!!! Wondering what's NeXT... :-) * **********************************************************************