Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!edsews!rphroy!teemc!ka3ovk!ki4pv!opus!homxb!cjn From: cjn@homxb.ATT.COM (C.NORTHRUP) Newsgroups: att.unix,comp.unix.wizards Subject: A Danger Message From UNIX Keywords: DANGER: out of swap space Message-ID: <3320@homxb.ATT.COM> Date: 14 Apr 89 14:04:39 GMT Distribution: usa Organization: AT&T BL Holmdel NJ USA Lines: 61 ------------------------------------------ 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 *********************************