This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Failure to build libjava on 512MB machine
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, Marco Trudel <mtrudel at gmx dot ch>, java at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Thu, 1 Feb 2007 22:19:30 +0100 (CET)
- Subject: Re: Failure to build libjava on 512MB machine
- References: <Pine.LNX.4.64.0701281729020.10489@acrux.dbai.tuwien.ac.at> <17855.12346.790265.312141@zebedee.pink> <45BF3596.8040203@gmx.ch> <17855.20818.92155.929454@zebedee.pink> <m3tzy8wapz.fsf@localhost.localdomain> <Pine.LNX.4.64.0701310255350.10003@acrux.dbai.tuwien.ac.at> <17856.25997.292976.620500@zebedee.pink>
On Wed, 31 Jan 2007, Andrew Haley wrote:
> Can you tell us a bit more about the config? It really shouldn't be
> failing to compile this program.
The tester where this problem first surfaced as a 32-bit Athlon machine,
with 512MB main memory and 1GB swap. The machine runs FreeBSD 5.4.
I agree with your intuition that even if the machines is swapping heavily,
this amount of virtual memory (1.5GB) should suffice.
However, a bit of investigations makes me believe that, at least in the
default configuration, FreeBSD 5.4 will refuse to allocate more memory to
a single process than the system has main memory.
At least this is what the output of the following quick test program I
hacked indicates:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define MB 1024*1024
main() {
for(int i=1; i <= 600; i++) {
printf("%dMB ",i); fflush(stdout);
char *p=(char*)malloc(MB);
if( p == NULL ) {
printf("\nCrap!\n");
return 1;
}
}
}
After 512MB, the output I get is
510MB
511MB
512MB
Crap!
while, at the same time, a GCC bootstrap is nicely proceeding on the
same machine. I do not know how many other system may behave similarly,
but at least this explains my (unexpected) bootstrap failures.
Gerald