Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!njin!princeton!udel!wuarchive!uunet!bywater!arnor!cirrus!rhoover From: rhoover@arnor.uucp Newsgroups: comp.unix.aix Subject: Re: Paging-space problems Message-ID: <1990Nov14.223820.29154@arnor.uucp> Date: 14 Nov 90 22:38:20 GMT References: <311@cadlab.sublink.ORG> Sender: news@arnor.uucp (NNTP News Poster) Reply-To: rhoover@cirrus.watson.ibm.com (Roger Hoover) Distribution: comp Organization: IBM T.J. Watson Research Center Lines: 48 In article , marc@arnor.uucp writes: |> malloc fails when the request causes the heap to exceed the |> ulimit for data. It has nothing to do with paging space. |> |> In AIX V3 the default data limit is quite large, which is why |> it appears to behave differently. |> |> Marc Auslander Well, this is not true under sunos. For example, consider the following program (called big.c): #include main() { while (malloc(1024*1024*4) != NULL) fprintf(stderr,"Another 4 meg\n"); fprintf(stderr,"That's all folks\n"); } cirrus% limit cputime unlimited filesize unlimited datasize 524280 kbytes stacksize 8192 kbytes coredumpsize unlimited memoryuse unlimited cirrus% /etc/pstat -s 15312k allocated + 4816k reserved = 20128k used, 29772k available cirrus% big Another 4 meg Another 4 meg Another 4 meg Another 4 meg Another 4 meg Another 4 meg Another 4 meg That's all folks cirrus% Every unix system that I have ever used has returned 0 when malloc can no longer allocate usable memory. When I malloc storage, I check for NULL and if my application has files to be written out, etc, I free some storage and clean up. I see this malloc issue as one of compatability. Programs should not have to be rewritten in order to run on IBM machines. If the /6000 version of malloc is faster, then a new call ( vmalloc() ? ) should be provided for fast memory allocation under the new semantics. Would you have been a happy camper if berkeley had replaced fork() with the vfork() semantics and had provided psfork() for compatability? roger rhoover@ibm.com