From owner-freebsd-questions@FreeBSD.ORG Thu Mar 7 11:48:16 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F88DD12 for ; Thu, 7 Mar 2013 11:48:16 +0000 (UTC) (envelope-from nvass@gmx.com) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by mx1.freebsd.org (Postfix) with ESMTP id 962CB347 for ; Thu, 7 Mar 2013 11:48:15 +0000 (UTC) Received: from mailout-eu.gmx.com ([10.1.101.214]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MT5po-1UNuLX0b3O-00S9WP for ; Thu, 07 Mar 2013 12:48:09 +0100 Received: (qmail invoked by alias); 07 Mar 2013 11:48:08 -0000 Received: from 188.4.187.226.dsl.dyn.forthnet.gr (EHLO [127.0.0.1]) [188.4.187.226] by mail.gmx.com (mp-eu014) with SMTP; 07 Mar 2013 12:48:08 +0100 X-Authenticated: #46156728 X-Provags-ID: V01U2FsdGVkX19tMWBGt7JtUXr9b7tqNIkC2MFrT5k3guG2Z91OKT JhsNX2+Ges3o9g Message-ID: <51387E79.80204@gmx.com> Date: Thu, 07 Mar 2013 13:48:09 +0200 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: Polytropon Subject: Re: process eating up all memory - what should happen next? References: <201303071001.r27A13A5000885@mech-cluster241.men.bris.ac.uk> <20130307111756.e4e31a9c.freebsd@edvax.de> In-Reply-To: <20130307111756.e4e31a9c.freebsd@edvax.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 Cc: mexas@bristol.ac.uk, freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2013 11:48:16 -0000 On 7/3/2013 12:17 μμ, Polytropon wrote: > On Thu, 7 Mar 2013 10:01:03 GMT, Anton Shterenlikht wrote: >> I have a process that eats up al memory, >> in my case science/paraview if I try to >> analyse a large model. What should FreeBSD >> do when a process tries to use all RAM or more? > > In this case, the swap space would be used, until the > system runs out of swap space. > > > >> I my case I get a complete freeze, can't even >> login from the console, and requiring a cold >> reboot. I guess this is not supposed to happen, >> but what is supposed to happen in situations like this? > > A normal reboot (including a proper shutdown) should > at least be possible. If the machine seems to freeze > entirely, this simply looks wrong, so maybe it's more > than just eating all the RAM? > > You could try to impose a resource limit, see "man limits" > for details, so you could "trigger" the undesired behaviour > while e. g. only 50% of the available RAM is being used > by _that_ process (and therefor still leaving enough > resources for other system and user processes). You could > also monitor resource consumption with tools like top, > htop, vmstat or systat in adjacent xterms while you run > the test, seeing "trouble pile up"... > > > I think Anton is interested in the system's behavior when there is no enforced limit. Processes tend to be killed quite quickly when there is no on-disk swap backing. > root@awethu:/root # swapinfo > Device 1K-blocks Used Avail Capacity > root@awethu:/root # nice python -c 'a = [f for f in range(80000000)]' > Killed When on-disk swap backing exists and multiple processes are competing for memory things are are not that straightforward. I think you hit a bug on ia64. Could you test the behavior using the above "program" and report back? I would run top in one terminal(so i can monitor and kill the program) and I would use a second terminal to run the program using increasingly larger values. Also, I wouldn't try that under X, at least i would test first without X... HTH, Nikos