On Tue, 1 Feb 2000, Mark Ivey wrote:

> Hi,
> I'm running RedHat 6.0 on a pentium 200 w/ 32 mb of ram and 60 mb of
> swap space.  The other day I was writing a program for a school assignment
> that basically makes a list of random numbers and then sorts them.  I told
> it to run with a size of 5 million, and then I watched as it used up all
> my swap space (I had xosview open) and my system stopped responding.  I
> tried switching out of X to one of the consoles, it wouldn't respond.  I
> tried telneting in to the machine, it wouldn't bring up the login prompt.
> Do I have something set up wrong, or is it really this easy crash linux?
> I wasn't logged in as root, and I had just compiled the program so it
> shouldn't have been suid.  What am I missing?
>

Running out of swap is a Bad Thing (TM). Usually all that happens is the
system will get very very slow, as in it might take a couple of minutes
for telnet to respond or switch VCs. The other thing is sort uses /tmp to
store files as it runs, if your machine is setup like most you don't have
a separate file system for /tmp. Which means / probably filled up as well,
which is another Bad Thing (TM). Again, that will generally make the
system incredibly slow and processes may start terminating if they happen
to not run as root.

You say you compiled your program, so I am assuming C is the language. Are
you checking for errors after trying to grab memory?

Linux let's you fully use the machine, it is very possible to write a
program that will really hog resources and bring the machine to its
knees.

Bill Carlson
------------
Systems Programmer    [EMAIL PROTECTED]    |  Opinions are mine,
Virtual Hospital      http://www.vh.org/        |  not my employer's.
University of Iowa Hospitals and Clinics        |



-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to