Subject: Re: out of memory locks my terminal up
To: None <jwjr@name.net>
From: Perry E. Metzger <perry@piermont.com>
List: netbsd-help
Date: 09/30/1998 18:41:56
James Wetterau writes:
> Unfortunately, I experienced a problem I've often experienced with
> perl; ballooning data structures.  It's easy to forget that the reason
> perl can do such nifty and quick things without caring about memory
> allocation or types, such as treating strings as numbers where
> appropriate and vice versa, is that it throws lots and lots of memory
> at the problem, pre-allocating aggressively.  And so, the perl
> program, working on and sorting about 1MB of string input representing
> about 10^ 5 unsigned ints, grew to use over 32MBs of memory in the
> resident set.  Just at the moment I was thinking it might be prudent
> to kill the process and re-write the script my terminal hung.

NetBSD used to behave fairly badly when it ran out of memory. It now
behaves far better (in -current), but what you have just experienced
is the result of the problems we had before post-1.3 NetBSD.

Now, of course, we have a re-written VM subsystem. We still have some
bugs with running low on VM, though.

If you really need to run programs like this regularly, setting your
ulimit to prevent the user dataset size from growing too large, or
upgrading to a UVM enabled version of -current, or even both, might be 
a good idea.

Meanwhile, I suspect after your perl script croaks and the system has
had a while to digest, your machine may recover on its own.

Perry