A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Fri Feb 3 04:34:00 GMT 2006


Hi,

I am a friendly script caring about memory consumption in GCC.  Please
contact jh@suse.cz if something is going wrong.

Comparing memory consumption on compilation of combine.i, insn-attrtab.i,
and generate-3.4.ii I got:


comparing combine.c compilation at -O0 level:
    Overall memory needed: 25324k
    Peak memory use before GGC: 9566k
    Peak memory use after GGC: 8913k
    Maximum of released memory in single GGC run: 2649k
    Garbage: 40060k
    Leak: 6740k
    Overhead: 5738k
    GGC runs: 313

comparing combine.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 6881k to 6889k, overall 0.12%
    Overall memory needed: 26892k
    Peak memory use before GGC: 17434k
    Peak memory use after GGC: 17255k
    Maximum of released memory in single GGC run: 2309k
    Garbage: 62588k -> 62589k
    Leak: 6881k -> 6889k
    Overhead: 7488k -> 7488k
    GGC runs: 393

comparing combine.c compilation at -O2 level:
    Overall memory needed: 26892k
    Peak memory use before GGC: 17436k
    Peak memory use after GGC: 17255k
    Maximum of released memory in single GGC run: 2388k
    Garbage: 80088k -> 80093k
    Leak: 6970k -> 6962k
    Overhead: 10033k -> 10032k
    GGC runs: 451 -> 450

comparing combine.c compilation at -O3 level:
    Overall memory needed: 26892k
    Peak memory use before GGC: 18273k
    Peak memory use after GGC: 17952k
    Maximum of released memory in single GGC run: 3378k
    Garbage: 111375k -> 111389k
    Leak: 7038k
    Overhead: 13722k -> 13723k
    GGC runs: 502

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 80948k
    Peak memory use before GGC: 69508k
    Peak memory use after GGC: 45044k
    Maximum of released memory in single GGC run: 36220k
    Garbage: 146427k
    Leak: 10131k
    Overhead: 19750k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 109560k -> 109164k
    Peak memory use before GGC: 91973k
    Peak memory use after GGC: 81071k
    Maximum of released memory in single GGC run: 32143k
    Garbage: 296462k
    Leak: 10054k
    Overhead: 36102k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 122560k
    Peak memory use before GGC: 109356k
    Peak memory use after GGC: 80974k
    Maximum of released memory in single GGC run: 31578k
    Garbage: 381018k
    Leak: 10156k
    Overhead: 47871k
    GGC runs: 274

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 122616k
    Peak memory use before GGC: 109382k
    Peak memory use after GGC: 80999k
    Maximum of released memory in single GGC run: 31908k
    Garbage: 381619k
    Leak: 10160k
    Overhead: 48068k
    GGC runs: 276

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 118252k
    Peak memory use before GGC: 95027k
    Peak memory use after GGC: 94080k
    Maximum of released memory in single GGC run: 20299k
    Garbage: 223448k
    Leak: 49470k
    Overhead: 37085k
    GGC runs: 369

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 108460k
    Peak memory use before GGC: 95143k
    Peak memory use after GGC: 93151k
    Maximum of released memory in single GGC run: 20158k
    Garbage: 563996k
    Leak: 52248k
    Overhead: 63607k
    GGC runs: 532

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 108564k
    Peak memory use before GGC: 95143k
    Peak memory use after GGC: 93152k
    Maximum of released memory in single GGC run: 20158k
    Garbage: 655320k
    Leak: 53066k
    Overhead: 75063k
    GGC runs: 597

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 110792k
    Peak memory use before GGC: 96537k
    Peak memory use after GGC: 94579k
    Maximum of released memory in single GGC run: 20582k
    Garbage: 713949k
    Leak: 53955k
    Overhead: 79319k
    GGC runs: 609

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-02-02 18:05:07.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-02-03 04:26:42.000000000 +0000
@@ -1,3 +1,21 @@
+2006-02-02  Zdenek Dvorak <dvorakz@suse.cz>
+	    Daniel Berlin  <dberlin@dberlin.org>
+
+	* tree-tailcall.c (arg_needs_copy_p): New function.
+	(eliminate_tail_call): Use arg_needs_copy_p.
+	(tree_optimize_tail_calls_1): Ditto. Also call add_virtual_phis.
+	(add_virtual_phis): New function.
+
+2006-02-02  Jakub Jelinek  <jakub@redhat.com>
+
+	* config/sparc/sparc.c (sparc_output_scratch_registers): Use
+	#ignore instead of #scratch for %g7 .register directive.
+
+2006-02-02  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* config/sparc/freebsd.h (ENDFILE_SPEC): Add space to separate
+	object files.
+
 2006-02-02  Bernd Schmidt  <bernd.schmidt@analog.com>
 
 	* flow.c (calculate_global_regs_live): Assert that there aren't any


The results can be reproduced by building a compiler with

--enable-gather-detailed-mem-stats targetting x86-64

and compiling preprocessed combine.c or testcase from PR8632 with:

-fmem-report --param=ggc-min-heapsize=1024 --param=ggc-min-expand=1 -Ox -Q

The memory consumption summary appears in the dump after detailed listing
of the places they are allocated in.  Peak memory consumption is actually
computed by looking for maximal value in {GC XXXX -> YYYY} report.

Your testing script.



More information about the Gcc-regression mailing list