process eating up all memory - what should happen next?

Nikos Vassiliadis nvass at
Thu Mar 7 11:48:16 UTC 2013

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 at awethu:/root # swapinfo
> Device          1K-blocks     Used    Avail Capacity
> root at 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

More information about the freebsd-questions mailing list