From owner-freebsd-questions@FreeBSD.ORG Sun Oct 30 04:21:15 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4355A16A420 for ; Sun, 30 Oct 2005 04:21:15 +0000 (GMT) (envelope-from dgl@kirk.dlee.org) Received: from rwcrmhc12.comcast.net (rwcrmhc13.comcast.net [216.148.227.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id C137143D48 for ; Sun, 30 Oct 2005 04:21:14 +0000 (GMT) (envelope-from dgl@kirk.dlee.org) Received: from kirk.dlee.org ([69.143.16.144]) by comcast.net (rwcrmhc13) with ESMTP id <2005103004211301500b9pphe>; Sun, 30 Oct 2005 04:21:14 +0000 Received: from kirk.dlee.org (dgl@localhost.dlee.org [127.0.0.1]) by kirk.dlee.org (8.12.11/8.12.11) with ESMTP id j9U4LC7u012442; Sun, 30 Oct 2005 00:21:12 -0400 (EDT) (envelope-from dgl@kirk.dlee.org) Received: (from dgl@localhost) by kirk.dlee.org (8.12.11/8.12.11/Submit) id j9U4LBgT012441; Sun, 30 Oct 2005 00:21:11 -0400 (EDT) (envelope-from dgl) Date: Sun, 30 Oct 2005 00:21:11 -0400 From: Doug Lee To: Giorgos Keramidas Message-ID: <20051030042111.GC9983@kirk.dlee.org> Mail-Followup-To: Doug Lee , Giorgos Keramidas , freebsd-questions@freebsd.org References: <20051029203404.GA9983@kirk.dlee.org> <20051029225953.GA56958@flame.pc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051029225953.GA56958@flame.pc> Organization: SSB + BART Group User-Agent: Mutt/1.5.9i Cc: freebsd-questions@freebsd.org Subject: Re: Can a process be made immune to out-of-swap-space kills? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2005 04:21:15 -0000 On Sun, Oct 30, 2005 at 01:59:53AM +0300, Giorgos Keramidas wrote: > On 2005-10-29 16:34, Doug Lee wrote: > > Sometimes, I accidentally run something that eats up too much > > memory and causes the pager to run out of swap space and start > > shooting down processes to rectify the situation. Sometimes, > > the process chosen for demolition happens to be `screen.' > > Since this process sorta manages a whole lot of others and, on > > being zapped out of existence, leaves many of them running but > > inaccessible, I find this choice decidedly inconvenient. > > > > Is there a way for me to force FreeBSD to leave `screen' (or > > any other process) alone when selecting something to kill to > > free memory? > > Hmmm, why are user limits not applied? Wouldn't it be a nicer > way to solve the "rogue process" problems? It turns out that the problem is not actually a memory request but a huge temp file in an MFS filesystem... so maybe I need to figure out how to limit the size of a mount_mfs so it can't blast processes out of existence. For the curious, I had tried a "sox ... reverse" operation, which reverses a wav file (and apparently does it by making a temporary copy rather than reading it backward, which I didn't know!), and the file in question was a wav about 240 megabytes long. This is a small home FreeBSD box and almost never hosts any user but me. My /tmp, a mount_mfs, is about 150 meg in size, according to `df.' The `sox' command ate that up so fast that the sheer volume of swap failure messages prevented me from acting quickly enough, and the pager shot down a whole bunch of processes trying to save the world. The list of shot processes happened to include `screen,' and this created a number of orphans that I had to kill subsequently myself, such as a stranded `ssh' session to another machine. So yes, I could stand for some tuning. On a multi-user system, this would be a most unwise way to leave things. -- Doug Lee dgl@dlee.org http://www.dlee.org SSB + BART Group doug@bartsite.com http://www.bartsite.com "I before E, except after C, or when sounded like A, as in neighbor and weigh, except for when weird foreign concierges seize neither leisure nor science from the height of society."