Re: Hang after running out of memory

From: Jan-Espen Pettersen <sigsegv_at_leakingmemory.org>
Date: Sun, 27 Apr 2003 22:09:43 +0200
On Saturday 26 April 2003 07:09, Lucky Green wrote:
> On Apr 20, "Craig Reyenga" wrote:
> > I have been following the thread here on current_at_ about problems
> > occuring when running out of memory, so I wrote a C++ program that
> > simply mallocs about 144M of memory. My system has 256MB+491MB(swap).
> > I can run the system out of memory just fine by running multiple
> > copies of the program, and the kernel does kill one if I run too many,
> >
> > however shortly after, when I go to killall the programs the system
> > hangs, (although pings, etc manage to survive for a few mintues
> > longer) and I have no choice but to press the reset button. While it
> > is hung, I _can_ press ^T and it shows the load, which increases by 1
> > about every 45 seconds:
>
> I have seen twice what I believe may be a similar problem: when logged
> in via ssh (puTTY), the terminal stops responding to commands. Unlike
> with an interrupted ssh connection, in which no characters are echoed,
> in this puTTY echoed ^C and ^Z literally to the screen. At that point,
> FreeBSD stops accepting SSH connections, though the machine continues to
> respond to pings. In each case, the server showed high loads due to GBDE
> and low memory, for so far unknown reasons (perhaps GBDE), just before
> the error occurred. Both time this happened, the server would again
> accept connections after about 30 min. There were no disk errors in the
> logs.
>
> --Lucky

I have also noticed that sometimes (during high filesystem activity) the 
amount of wired memory increases rapidly eating up all the memory that should 
have been used as program memory... then the most active programs starts to 
generate 'page faults' since most of the allocated memory were swapped out. 
At that point the HDD-IO activity goes to nearly zero, even though all active 
programs are waiting for the swapper to swap in their memory, when it has 
gone that far there are almost no keyboard echo, and the only option is to 
push the reset button.

The last data I got from top was something like this (I can't recall all the 
details):

Active memory: about 700K,
Inactive: about 400K - 700K,
Wired: 230M+,
Cache: not sure, but I think it was around 5M to 10M
Buf: around 10M - 30M
Free: 300K - 700K

Swap usage: at least 150M.

(Total amount of memory: 248M)
Received on Sun Apr 27 2003 - 11:09:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:05 UTC