From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,242283f843c07209 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-06-09 16:18:40 PST Path: gmd.de!xlink.net!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!edo From: edo@magnus.acs.ohio-state.edu (Eric D Osborne) Newsgroups: comp.sys.dec Subject: Re: Memory usage and Swap space Date: 9 Jun 1993 23:16:02 GMT Organization: Digital Equipment Corporation (sent via the Ohio State University) Sender: Eric D. Osborne Distribution: world Message-ID: <1v5qvi$4m9@charm.magnus.acs.ohio-state.edu> References: <1v5lk7INNg17@gap.caltech.edu> NNTP-Posting-Host: top.magnus.acs.ohio-state.edu Keywords: memory swap The virtual process sizes on DEC OSF/1 reflect the sizes of the shared libraries that are linked into the executables. The virtual sizes don't have any direct bearing on the actual memory or swap consumption, though, since the bulk of the pages in use are shared. Static initialized data in shared libraries DOES count against the RSS (a much more accurate view of the actual memory consumption of a given process), but only IF the machine is in "eager" swap mode. Eager swap is the classical BSD behaviour. It essentially requires vm objects to be backed up with page space on allocation, whether or not the object will ever be used. This is inefficient in some regards. Consider, for example, a case in which you put 1GB of ram into a machine in order to insure that you NEVER page. With eager swap, you have to allocate a huge (but almost certainly unused) swap space. DEC OSF/1 also allows the use of "lazy" swap evaluation. This is done by removing /sbin/swapdefault (a symlink to the primary swap device) and rebooting. In this mode, page space is allocated on actual demand as opposed to when the virtual object is created. This means that for situations like the above, the virtual memory becomes effectively the size of ram plus the page space - a much more effective utilization of resources. The down side to lazy evaluation is that you can over-commit page space. In that scenario (like the machine I'm on - a 3000/500 with 256MB of memory, but 127 MB of swap) I can allocate memory until I run out, then things start to page. The thing is, I can have more things allocated than I have page space for. If that happens, some processes will likely die an unpleasant death. Both methods have their points, both good and bad. Eager swap generates more deterministic behavior, but is somewhat less resource efficient. I'd tend to recommend it for, say, a database server in a commercial application. Lazy swap is great for code development, or for stuff doing sparse arrays, and other applications where large VM objects get allocated but only smally pieces actually get touched. The nice thing is that DEC OSF/1 does both - I think it is the only UNIX implementation from a major vendor that does that ;-) Your mileage will vary, and the method that is best depends on your application. It is very easy to change, though, by deleting or restoring the symlink and rebooting. Eric Osborne edo@hill.enet.dec.com *************************** std_disclaimer.h ******************************* The opinions expressed above are those of Eric D. Osborne, and do not necessarily represent those of Digital Equipment Corporation. The opinions expressed are offered without any warranty as to fitness for a particular purpose, either express or implied. In other words, don't take my word for anything I said above, I may only think I know what I was talking about. ****************************************************************************