From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078728412059.tru64-unix-managers.marc@archive.invalid> From: Judith Reed Date: Thu, 19 Nov 1998 21:11:49 +0000 To: tru64-unix-managers Subject: SUMMARY: Insufficient eager swap - crashes program? X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078728412059 Thanks to all who responded with info - alan@nabeth.cxo.dec.com speno@isc.upenn.edu gwb@liver.csc.umd.edu sean@stat.Duke.EDU shurtlef@latrade.com Alan came thru first with the info below that insufficient swap would cause a malloc to fail, and presumeably if the program can't handle that failure it could then crash. Others talked about kernel params. I'm framing a follow-up question on kernel params - seems to be a black art as to how to set them! Informative pieces of responses follow. Thanks again! -- Judith Reed jreed@appliedtheory.com ========================================================================== Insufficient page/swap space is one of the reasons that malloc (and company) will return NULL and set the errno value to ENOMEM. Running into the process data size limit will also do it. Think 1 GB happens to be the default system maximum for the data size limit (128 MB being the process default limit). There may be other system virtual memory parameters that will limit the size. ========================================================================== Eager swap must preallocate (on disk) all of the virtual space that it needs for every syscall (printf, etc). : >From the man page on swapon: There are two strategies for swap space allocation: immediate mode and deferred or over-commitment mode. The two strategies differ in the point in time at which swap space is allocated. If immediate mode is used, swap space is allocated when modifiable virtual address space is created. If deferred mode is used, swap space is not allocated until the system needs to write a modified virtual page to swap space. Immediate mode is the default swap space allocation strategy. ========================================================================== [my query] > We have a server that is a dedicated search engine. Of late, the primary > process on it has taken to dying when its virtual size reaches 1024MB, which > is the size of physical memory. It makes a core file, and I've been told the > error in the core file says it is dying on a: > > "check for null return from malloc - essentially the system saying it won't > give the process any more memory" > > according to the lead programmer. The odd thing about this system is > that it has 767MB of swap, with that 1GB memory (don't ask me why, unknown). > > It is running eager swap, and the system is DU40d on a 4100. > > Does it seem likely that malloc would fail once the process's virtual size > reaches memory size, given that there is insufficient swap to swap the whole > process out, were that necessary?