From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,6fdf80ce2c2591e7 X-Google-Attributes: gidfee84,public From: alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.) Subject: Re: Swap space problem Date: 1996/08/29 Message-ID: <504uhc$fa2@nntpd2.cxo.dec.com>#1/1 X-Deja-AN: 177362040 distribution: world references: <322489A4.1DF2@sandoz.com> organization: Digital Equipment Corporation reply-to: alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.) newsgroups: comp.unix.osf.osf1 In article <322489A4.1DF2@sandoz.com>, Ekkehard Goerlach writes: >On one of our machines we still run OSF/1 V2.0. Frequently we have a >swap space problem on that workstation (a AXP 3000/300), i.e. the >system issues messages like >"Unable to allocate swap space". > >Right now it seems to me that this is correlated to whether some >directories hold a large number (several thousand) files. When these >files are archived away, the system is quiet again. > >Is that observation resonable ? Do you have an application that allocates dynamic memory according to how many files are stored in that directory? If so, then it might be related. Otherwise, I doubt it. The inability to "allocate" page/swap space is nearly always due to there not being enough. If you're running in the default page/swap allocation mode, "allocate" really means reserve. DEC OSF/1 (now Digital UNIX) supports two page/swap space allocation methods, often called "eager" and "lazy". Eager is the default. This method reserves page and swap space as virtual memory is created. The space isn't actually allocated on the page/swap devices until it is needed. The reservation ensures that if space is needed there will be enough. The disadvantage is that it limits the system wide amount of virtual memory to the amount of page/swap space. The other method, "lazy", doesn't reserve the space. As before it is allocated when needed. The advantage is that the limit of system virtual memory is now limited the amount of page/swap space plus the amount of available memory. The disadvantage is rather severe. If a process needs page/swap space and there isn't any available, then some other process will be killed so its space can be used. The goal is to keep the current process running. So, it is a trickle down affect: o the current process wants more memory o some other process using memory is selected to be paged or swapped out, but there's no page/swap for it. o Some other process is selected and killed, so the paging processing can use the space. On systems where the amount of page/swap needed is very predictable, it allows sizing memory and page/swap space to exactly fit the application. On a system where the amount of page/swap space needed isn't very predictable, it is fairly dangerous, because useful processes can be killed off. >Can I change some system parameters to improve things ? If the problem is lack of page/swap space and you're willing to risk the disadvantages of "lazy" mode, remove the file /sbin/swapdefault and reboot. If you're not willing to risk it, but sufficient page/swap space is the problem, get more. Alternately, find a way to get your programs to use less memory. >Is this unique to V2.0 or might it happen on V3.2, too ? People underestimating how much page/swap space they'll need has been a problem since V1.2. V1.2 made it particularly hard since it used a dynamic memory allocation algorithm that was very unfriendly to large memory allocations. That was fixed in V1.3. V3.2C saw some improvment in virtual memory usage and the ability to configure some systems for smaller amounts of physical memory. I'm not sure that a lack of reservable page/swap space is the problem, but is the most common cause of this symtom. > >Any hints or help are welcome >Ekkehard > >-------------------------------------------------------------------- >Ekkehard Goerlach c/o Sandoz Pharma Ltd. >PCB/CF Structural and Analytical Chemistry CH-4002 Basle >email: ekkehard.goerlach@sandoz.com Switzerland > -- Alan Rollow alan@nabeth.cxo.dec.com