Subject: Re: out of memory locks my terminal up
To: None <perry@piermont.com, netbsd-help@netbsd.org>
From: James Wetterau <jwjr@name.net>
List: netbsd-help
Date: 10/01/1998 19:35:59
"Perry E. Metzger" says (original message order scrambled):


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

As it turned out I gave it a little over 24 hours and neither ssh
login nor the console responded.  The machine was locked up tight.
Interestingly, (to me anyway) NAT continued to work just fine, and
the response time for pings remained reasonable.
...


> James Wetterau writes:
> > Unfortunately, I experienced a problem I've often experienced with
> > perl; ...  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.
...

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

Hmm, I stumbled across it on literally the first new program I wrote.
I must say it really gave me pause.  I'll consider using current but
I wonder if a warning of some kind is in order for anyone installing a
non-current release?  It's really nasty to suddently find yourself
locked out of your machine because you used all the available memory
-- this is UNIX after all.

> If you really need to run programs like this regularly,

I was mainly testing out truerand, but the Perl script was not
atypical of the kind of thing I expect to do frequently.  A quick and
dirty hack followed by cleaning it up and making it efficient.

> 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.

Speaking of ulimits, man ulimit turns up nothing and it's not in my
path.  Where is it?

Later,
James