A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Mon Jul 24 22:12: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: 24721k
    Peak memory use before GGC: 9160k
    Peak memory use after GGC: 8547k
    Maximum of released memory in single GGC run: 2580k
    Garbage: 38214k
    Leak: 6052k
    Overhead: 5326k
    GGC runs: 307

comparing combine.c compilation at -O1 level:
    Overall memory needed: 36353k -> 36361k
    Peak memory use before GGC: 16999k
    Peak memory use after GGC: 16828k
    Maximum of released memory in single GGC run: 2261k
    Garbage: 56533k -> 56528k
    Leak: 6066k
    Overhead: 6070k -> 6069k
    GGC runs: 378

comparing combine.c compilation at -O2 level:
    Overall memory needed: 26496k
    Peak memory use before GGC: 16997k
    Peak memory use after GGC: 16828k
    Maximum of released memory in single GGC run: 2254k
    Garbage: 80311k -> 80296k
    Leak: 6170k
    Overhead: 8602k -> 8598k
    GGC runs: 446

comparing combine.c compilation at -O3 level:
    Overall memory needed: 25600k
    Peak memory use before GGC: 18087k
    Peak memory use after GGC: 17424k
    Maximum of released memory in single GGC run: 3346k -> 3329k
    Garbage: 109847k -> 109814k
    Leak: 6247k -> 6247k
    Overhead: 11874k -> 11868k
    GGC runs: 496 -> 493

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 81376k
    Peak memory use before GGC: 68248k
    Peak memory use after GGC: 43996k
    Maximum of released memory in single GGC run: 35708k
    Garbage: 138286k
    Leak: 9116k
    Overhead: 18992k
    GGC runs: 241

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 102616k
    Peak memory use before GGC: 83566k
    Peak memory use after GGC: 77686k
    Maximum of released memory in single GGC run: 31934k
    Garbage: 268543k -> 268544k
    Leak: 8940k
    Overhead: 29970k -> 29968k
    GGC runs: 235

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 103652k
    Peak memory use before GGC: 87827k
    Peak memory use after GGC: 79920k
    Maximum of released memory in single GGC run: 30382k
    Garbage: 314654k -> 314655k
    Leak: 8935k
    Overhead: 36953k -> 36950k
    GGC runs: 263

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 103660k
    Peak memory use before GGC: 87853k
    Peak memory use after GGC: 79946k
    Maximum of released memory in single GGC run: 30573k
    Garbage: 315245k -> 315246k
    Leak: 8938k
    Overhead: 37133k -> 37130k
    GGC runs: 267

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 116456k
    Peak memory use before GGC: 92791k
    Peak memory use after GGC: 91863k
    Maximum of released memory in single GGC run: 19688k
    Garbage: 214070k
    Leak: 47149k
    Overhead: 22154k
    GGC runs: 416

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 93832k to 95009k, overall 1.25%
  Peak amount of GGC memory still allocated after garbage collectin increased from 92903k to 93237k, overall 0.36%
    Overall memory needed: 112976k -> 113632k
    Peak memory use before GGC: 93832k -> 95009k
    Peak memory use after GGC: 92903k -> 93237k
    Maximum of released memory in single GGC run: 18471k -> 18467k
    Garbage: 437101k -> 435581k
    Leak: 48570k -> 48579k
    Overhead: 31872k -> 31505k
    GGC runs: 557 -> 560

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 93832k to 95010k, overall 1.26%
  Peak amount of GGC memory still allocated after garbage collectin increased from 92903k to 93238k, overall 0.36%
    Overall memory needed: 112952k -> 113592k
    Peak memory use before GGC: 93832k -> 95010k
    Peak memory use after GGC: 92903k -> 93238k
    Maximum of released memory in single GGC run: 18470k -> 18467k
    Garbage: 521361k -> 520513k
    Leak: 49262k -> 49267k
    Overhead: 39538k -> 39218k
    GGC runs: 635 -> 632

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 114920k -> 114924k
    Peak memory use before GGC: 96315k -> 96316k
    Peak memory use after GGC: 94524k -> 94523k
    Maximum of released memory in single GGC run: 18769k -> 18768k
    Garbage: 539246k -> 537594k
    Leak: 49601k -> 49590k
    Overhead: 40691k -> 40295k
    GGC runs: 643 -> 650

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-07-24 10:08:03.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-07-24 20:59:39.000000000 +0000
@@ -1,3 +1,23 @@
+2006-07-24  Richard Guenther  <rguenther@suse.de>
+
+	PR middle-end/28463
+	* cgraph.c (cgraph_remove_node): Do not check if dumps
+	are enabled.
+	* cgraphunit.c (cgraph_optimize): Likewise.
+
+2006-07-24  Jan Hubicka  <jh@suse.cz>
+
+	PR rtl-optimization/28071
+	* tree-cfg.c (tree_split_block): Do not allocate new stmt_list nodes.
+	* tree-iterator.c (tsi_split_statement_list_before): Do not crash when
+	splitting before first stmt.
+
+2006-07-24  Jan Hubicka  <jh@suse.cz>
+
+	PR rtl-optimization/28071
+	* ipa-inline.c (update_caller_keys): Remove edges that
+	are no longer inline candidates.
+
 2006-07-23  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	PR debug/27473


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