gcc memory consumption: amd64 v i386

Garrett Cooper youshi10 at u.washington.edu
Sat May 26 04:06:04 UTC 2007


Michiel Boland wrote:
> Hi. I noticed that compilation of xorg-server on i386 with the new gcc 
> proceeds normally, whereas compilation on amd64 would crash because the 
> compiler would consume all memory. The i386 and amd64 boxen have the 
> same amount of RAM and swap, obviously. And they run, give or take a few 
> hours, more or less same version of -CURRENT.
> 
> So it appears that memory consumption of gcc on amd64 is significantly 
> greater than on i386. To test this further I created a very simple C 
> source file:-
> 
> void n0() { }
> void n1() { }
> void n2() { }
> void n3() { }
> ...
> void n49998() { }
> void n49999() { }
> 
> (i.e. a file with 50000 trivial function definitions.)
> 
> I compiled this file with several optimization levels, and then got the 
> following
> 
>              no optimization    -O
>   amd64        164M            445M
>   i386         142M            247M
> 
> I was wondering if anyone can make any sense out of this.
> 
> Cheers
> Michiel

What are your CFLAGS and CXXFLAGS? What -O did you build with?
-Garrett


More information about the freebsd-current mailing list