Xref: utzoo comp.unix.questions:31744 comp.lang.c:39652 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!uunet!stanford.edu!unix!ace!ric From: ric@ace.sri.com (Richard Steinberger) Newsgroups: comp.unix.questions,comp.lang.c Subject: Finding/changing max memory size available Message-ID: <24817@unix.SRI.COM> Date: 28 May 91 15:41:43 GMT Sender: news@unix.SRI.COM Reply-To: ric@ace.sri.com (Richard Steinberger) Followup-To: comp.unix.questions Organization: SRI International Lines: 32 The following short program finds the maximum amount of memory that can be allocated through use of malloc(). What I'd like to know is, "Where/How is this limit set? Is this a a function of 1 or more kernel parameters, or other system configuration variables?" Can the upper allocatable memory limit be changed (without adding physical memory, of course)? Thanks for any replies. regards, ric steinberger ric@ace.sri.com /****************************************************************************/ #include #include #define MALLOC_SIZE 1000000L /* Number of bytes to allocate / call */ main() { char *cptr; long i; while ((cptr = malloc(MALLOC_SIZE)) != NULL) i++; printf("Total memory allocated = %u bytes.\n", i*MALLOC_SIZE); exit(0); } /****************************************************************************/