malloc

rudy at chukran.austin.ibm.com rudy at chukran.austin.ibm.com
Fri Feb 1 06:02:05 AEST 1991


> > Now that we have 64 Mbytes, does anyone know how to configure
> > the kernel such that malloc will allocate 64 mbytes (or more) ?
> > Right now, malloc refuses to allocate more than 32 mbytes and
> > we have not been able to figure out how to change this.
> >
> 
> I think that you need to look at the 'ulimit' command.  At least on my
> machine, the limit for memory is 32M.
More specifically, check the ulimit subcommand of sh or the limit subcommand
of csh.  You should be interested in the data size.  Be aware that you cannot
get more than 256M of memory, no matter what ulimit tells you (mine tells me
262000 kilobytes, which is impossible) due to architectural limit of segment
size.  Be aware also that repetitive mallocs of small sizes will fragment
the freespace so that there may be an agregate of 32M , but not a contiguous
amount.  To test this, try a test program which mallocs 64M the first thing it
does.  Keep in mind that all program stack , static data, external data all
come out of the data segment.  Id suggest checking your program sizes with
the size command to see how much data is allocated from the data segment
before your program starts to run.  It may indeed be that there is not
32M left to malloc.

*********************************************************************
IBM AIX Porting Center  | RSCS: CHUKRAN at AUSTIN 
11400 Burnet Rd.        | AWDnet: rudy at chukran.austin.ibm.com    
Internal ZIP 2830       | internet: chukran at austin.iinus1.ibm.com
Austin, Texas 78758     | Voice: 512-838-4674  Tieline: 678-4674
*********************************************************************



More information about the Comp.unix.aix mailing list