A Danger Message From UNIX

C.NORTHRUP cjn at homxb.ATT.COM
Sat Apr 15 00:04:39 AEST 1989


------------------------------------------


OK people, this should be a interesting question for you.....

First, some background:

	We have a simple program with the following code fragment:

	for(i=0;i<4096;++i)
		if( (memptr[i] = malloc(80540)) == (char *) NULL)
		{
			perror("mt");
			break;
		}


Now, the scenario:
	
	While running multiple versions of this in the background, 
	(loged on as a general user) the following message started 
	appearing on the system console:

	DANGER: out of swap space.


Finally, the question:
	Since the five (or so) invocations of the program consumed
	minimal space prior to the mallocs, how should the OS
	have handled this?  Should the mallocs have failed?
	Or is this considered acceptable.

NOTE 1:	I know that increasing the swap space would make the problem
	go away, but that is not what I need to know...  The real
	question is how should the OS handle this.....
	
	
NOTE 2: This happened on a Motorola VME147A running 5.3



			- charlie northrup
			  homxb!cjn

			  at&t bell labs
			  480 red hill road
			  middletown, nj
			  (201)615-4508

** standard disclaimer implied


*********************************
 "Hank is the type of person you buy for what he is worth, and sell
  for what he thinks he is worth.  That is how you make money."
					- ajn '84
*********************************
 "A redneck is a cowboy with an attitude problem"
					- dillard '88

*********************************



More information about the Comp.unix.wizards mailing list