From owner-freebsd-current Fri Feb 5 09:25:26 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA16107 for freebsd-current-outgoing; Fri, 5 Feb 1999 09:25:26 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from nhj.nlc.net.au (nhj.nlc.net.au [203.24.133.1]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id JAA16094 for ; Fri, 5 Feb 1999 09:25:21 -0800 (PST) (envelope-from john.saunders@nlc.net.au) Received: (qmail 15777 invoked by uid 1000); 6 Feb 1999 04:25:14 +1100 Date: 6 Feb 1999 04:25:14 +1100 Message-ID: <19990205172514.15774.qmail@nhj.nlc.net.au> From: "John Saunders" To: Brian Feldman Cc: freebsd-current@FreeBSD.ORG Subject: Re: swapper BIG problems X-Newsgroups: nlc.lists.freebsd-current In-Reply-To: User-Agent: tin/pre-1.4-980818 ("Laura") (UNIX) (Linux/2.0.37 (i686)) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In nlc.lists.freebsd-current you wrote: > If you looked at the "prgram" (term used loosely) it touches every bit of > memory it allocates. I seemed to have overlooked the bit where you wrote deadbeef. I took a closer look. What I think is happening is that as the blocks are allocated and then touched, physical RAM is allocated. As you continue the oldest touched blocks get allocated to swap to make RAM available for touching new pages. You will reach a stage where you fill all of swap _and_ all of the free RAM pages. It's very likely that some part of your code hasn't been paged into RAM yet. But when it does need to there are no free RAM pages. When the swapper tries to make some free RAM pages by swapping out, guess what no swap available. > The pages were already touched and in swap. After each page was read in by > the pager, the printf() tried to malloc but generated the error (as it seems > to me). Maybe not tried to malloc, but simply for the shared library or some part of your code to be paged in for execution. This is a hard problem to fix reliably. However try limiting the max memory size (ulimit -m xxx). I believe this should limit the resident set size (RSS) for the process, therefore it will fail to allocate more memory before all of available RAM is allocated. Cheers. -- +------------------------------------------------------------+ . | John Saunders - mailto:john@nlc.net.au (EMail) | ,--_|\ | - http://www.nlc.net.au/ (WWW) | / Oz \ | - 02-9489-4932 or 041-822-3814 (Phone) | \_,--\_/ | NHJ NORTHLINK COMMUNICATIONS - Supplying a professional, | v | and above all friendly, internet connection service. | +------------------------------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message