[comp.sys.encore] memory limits

george@iguanodon.cis.ohio-state.edu (George M. Jones) (02/11/89)

Confusion.  I wrote a program that does little more than malloc a number
of bytes specified on the command line.  It also calls getrlimit(2) to
see what my "hard" and "soft" limits are for data, stack and resident
size.  All come up 16 Meg ( 2**24 - 1), yet malloc fails when I try to
get much more than 8 Meg.  share(2) does a little better, failing at between
12 and 13 meg.  I am on a DPC system with 32 Meg physical memory and (at the 
time) not much else going on.  Ideas ? What am I missing ?

---George Jones
OSU Computer & Inf. Science 2036 Neil Ave.,Columbus,Ohio 43210. 614-292-7325
george@cis.ohio-state.edu or ...!osu-cis!george
Have yourself a merry little Christmas.
-=-
OSU Computer & Inf. Science 2036 Neil Ave.,Columbus,Ohio 43210. 614-292-7325
george@cis.ohio-state.edu or ...!osu-cis!george
Have yourself a merry little Christmas.

madd@bu-cs.BU.EDU (Jim Frost) (02/13/89)

In article <34669@tut.cis.ohio-state.edu> George M. Jones <george@cis.ohio-state.edu> writes:
|Confusion.  I wrote a program that does little more than malloc a number
|of bytes specified on the command line.  It also calls getrlimit(2) to
|see what my "hard" and "soft" limits are for data, stack and resident
|size.  All come up 16 Meg ( 2**24 - 1), yet malloc fails when I try to
|get much more than 8 Meg.  share(2) does a little better, failing at between
|12 and 13 meg.  I am on a DPC system with 32 Meg physical memory and (at the 
|time) not much else going on.  Ideas ? What am I missing ?

What size mallocs are you using?  I assume you realize that malloc
takes up some space for internal organization (size of malloc'ed chunk
is certainly going to be present) so smaller chunks could use
substantial amounts of memory over a large number of mallocs.  Also,
if the size of your malloc doesn't exactly fit the size of area
malloc can return (usually they malloc to double-word boundaries
although this can vary) you can loose quite a bit of space there.

Of course, malloc is still subject to actual resources available
(regardless of software imposed limits) so you may just be running
out.

jim frost
madd@bu-it.bu.edu