Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Mar 2013 13:48:09 +0200
From:      Nikos Vassiliadis <nvass@gmx.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        mexas@bristol.ac.uk, freebsd-questions@freebsd.org
Subject:   Re: process eating up all memory - what should happen next?
Message-ID:  <51387E79.80204@gmx.com>
In-Reply-To: <20130307111756.e4e31a9c.freebsd@edvax.de>
References:  <201303071001.r27A13A5000885@mech-cluster241.men.bris.ac.uk> <20130307111756.e4e31a9c.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51387E79.80204>