From: Richard Henderson <richard@atheist.tamu.edu>
Subject: Re: A problem porting sbrk
Date: Mon, 24 Feb 1997 11:29:40 -0600 (CST) [thread overview]
Message-ID: <b31daf911242555127d5ca40e9e5d96c.axp-list@archive.invalid> (raw)
In-Reply-To: <199702232301.PAA30446@hedrock.ps.uci.edu>
> However, it seems to me that this doesn't address the main
> problem. Regardless of the way the "out of memory" error is reported,
> the OSF program isn't able to get as much memory as the same
> program compiled with gcc on the linux machine itself.
I don't see this effect. To be sure, I modified your program a
little to make sure memory was actually being allocated, rather
than getting a few hundred thousand copy-on-write duplicates of
the zero page. I append it.
In any case, on a machine with 64MB ram and no swap, I get 5227
pages allocated by a native linux application, and 5100 pages
allocated by a static OSF application -- roughly 40.8MB and 39.8MB
respectively. Some but not all of that can be explained by the
larger static binary, but in any case would not seem to indicate
the problem you describe.
Disregarding ulimits, there should be no arbitrary limit to how
much memory an application can grab, native or otherwise.
Can anyone else duplicate this problem? I recommend trying this
without to terribly much swap, as it can take forever to page
through even a 64M partition.
r~
#include <stdio.h>
extern void * sbrk(long inc);
int main()
{
int i = 0;
long *pa;
while(1)
{
pa = sbrk(8*1024);
printf("%p %d\n",pa,++i);
printf("%ld\n",*pa = 1);
}
}
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next parent reply other threads:[~1997-02-24 17:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199702232301.PAA30446@hedrock.ps.uci.edu>
1997-02-24 17:29 ` Richard Henderson [this message]
1997-02-24 19:38 A problem porting sbrk Steven White
-- strict thread matches above, loose matches on Subject: below --
1997-02-23 23:01 Steven White
[not found] <199702230245.UAA27778@atheist.tamu.edu>
1997-02-23 17:12 ` Richard Henderson
1997-02-22 2:01 Steven White
1997-02-23 2:45 ` Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox