[comp.unix.questions] memory/swap

gwoho@nntp-server.caltech.edu (g liu) (06/07/91)

a program like: for (;;) if (malloc(1000))puts("a");
seems to me only to be able to allocate about 6m on this 8m 386
sysv at&t unix machine. there must be about 24m of swap.
why is this?
how do i allocate more memory that that? is it a ulimit problem?
gwoho liu.

cpcahil@virtech.uucp (Conor P. Cahill) (06/07/91)

gwoho@nntp-server.caltech.edu (g liu) writes:

>a program like: for (;;) if (malloc(1000))puts("a");
>seems to me only to be able to allocate about 6m on this 8m 386
>sysv at&t unix machine. there must be about 24m of swap.
>why is this?

This is because the maximum program size is set to 6MB.  The 
tunable parameter MAXUMEM specifies how many 4K pages a programs 
virtual space is allowed to take up.
-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 

gwyn@smoke.brl.mil (Doug Gwyn) (06/08/91)

In article <1991Jun6.215038.20384@nntp-server.caltech.edu> gwoho@nntp-server.caltech.edu (g liu) writes:
>is it a ulimit problem?

Not quite, because ulimit applies to file size, not process size.
Most likely there is a process size limit that you're bumping into.
Note that it is unreasonable to try to make a process as large as
the entire swap space.