optimization/10155: [3.3/3.4 regression] gcc -O2/-O3 uses excessive amount of memory

Peter van Hoof p.van-hoof@qub.ac.uk
Tue May 6 21:09:00 GMT 2003


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10155


> It looks like it's related to the amount of RAM in your
> box.  For me, GCC -O2 never consumes more than 40MB, and
> my machine has 192MB.  If your system pulls it off to
> keep cc1 alive up to 1772MB, then I suppose you have at
> least four times as much, so your GC param settings will
> be much larger than mine --> GCC eats more memory.  That
> _should_ give you a nice speedup over older GCC 3.x...
> So perhaps we can change the synopsis to reflect that his
> really only is a bug with -O3.
> 
> Peter, if you compile with "gcc -v", you can see your
> garbage collector parameter settings.  For me they are:
> GGC heuristics: --param ggc-min-expand=42 --param ggc-min-heapsize=23891
> 
> Can you show us your settings?

Now that my computer is back in the land of the living, I can finally answer 
this (in case it is still relevant)... I ran the initial test case on a Sun 
Blade 100 with 2GB of RAM, these are the settings with this machine:

GNU C version 3.4 20030504 (experimental) (sparc-sun-solaris2.9)
	compiled by GNU C version 3.4 20030504 (experimental).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

The compiler reaches a maximum size of 1894MB, which means that the machine has 
to swap out some other processes. I also have an Ultra 5 with 640MB of RAM, 
these are the settings on that machine

GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81920

I killed the compilation when the compiler grew to >1700MB because swap space 
was running dangerously low, i.e. on this machine the compiler would use up all 
the swap space it could get its hands on.


Hope this helps...

Peter.



More information about the Gcc-bugs mailing list