A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Fri Sep 1 02:56: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: 24781k
    Peak memory use before GGC: 8930k
    Peak memory use after GGC: 8565k
    Maximum of released memory in single GGC run: 2576k
    Garbage: 35002k -> 34997k
    Leak: 6058k
    Overhead: 4736k -> 4736k
    GGC runs: 296

comparing combine.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 6071k to 6079k, overall 0.13%
    Overall memory needed: 36205k -> 36201k
    Peak memory use before GGC: 17003k
    Peak memory use after GGC: 16831k
    Maximum of released memory in single GGC run: 2264k
    Garbage: 54875k -> 54708k
    Leak: 6071k -> 6079k
    Overhead: 5752k -> 5746k
    GGC runs: 372 -> 373

comparing combine.c compilation at -O2 level:
    Overall memory needed: 26500k
    Peak memory use before GGC: 17000k
    Peak memory use after GGC: 16831k
    Maximum of released memory in single GGC run: 2254k -> 2253k
    Garbage: 78555k -> 78368k
    Leak: 6181k -> 6173k
    Overhead: 8280k -> 8265k
    GGC runs: 440

comparing combine.c compilation at -O3 level:
    Overall memory needed: 25596k
    Peak memory use before GGC: 18099k -> 18090k
    Peak memory use after GGC: 17435k -> 17427k
    Maximum of released memory in single GGC run: 3330k -> 3325k
    Garbage: 107588k -> 107163k
    Leak: 6253k -> 6250k
    Overhead: 11425k -> 11415k
    GGC runs: 486

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 83700k
    Peak memory use before GGC: 68249k
    Peak memory use after GGC: 43997k
    Maximum of released memory in single GGC run: 35709k
    Garbage: 126252k -> 126249k
    Leak: 9118k
    Overhead: 16889k -> 16889k
    GGC runs: 230

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 103092k -> 103608k
    Peak memory use before GGC: 83524k
    Peak memory use after GGC: 77617k
    Maximum of released memory in single GGC run: 31805k
    Garbage: 259523k -> 259521k
    Leak: 8930k
    Overhead: 28453k -> 28452k
    GGC runs: 232

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 105708k
    Peak memory use before GGC: 87821k
    Peak memory use after GGC: 79916k
    Maximum of released memory in single GGC run: 30384k
    Garbage: 305998k -> 305996k
    Leak: 8935k
    Overhead: 35479k -> 35479k
    GGC runs: 257

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 105392k
    Peak memory use before GGC: 87847k
    Peak memory use after GGC: 79943k
    Maximum of released memory in single GGC run: 30571k
    Garbage: 306588k -> 306586k
    Leak: 8938k
    Overhead: 35656k -> 35656k
    GGC runs: 261

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 116276k -> 116272k
    Peak memory use before GGC: 92435k
    Peak memory use after GGC: 91514k
    Maximum of released memory in single GGC run: 19648k
    Garbage: 199939k -> 199817k
    Leak: 47214k
    Overhead: 20482k -> 20461k
    GGC runs: 398

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 115240k -> 115252k
    Peak memory use before GGC: 97008k
    Peak memory use after GGC: 94817k
    Maximum of released memory in single GGC run: 18293k
    Garbage: 436501k -> 435519k
    Leak: 49029k -> 49028k
    Overhead: 31257k -> 31211k
    GGC runs: 551 -> 550

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 115276k -> 115280k
    Peak memory use before GGC: 97009k
    Peak memory use after GGC: 94817k
    Maximum of released memory in single GGC run: 18293k
    Garbage: 522536k -> 522134k
    Leak: 49744k -> 49743k
    Overhead: 39343k -> 39289k
    GGC runs: 627

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 116620k -> 116640k
    Peak memory use before GGC: 98447k -> 98446k
    Peak memory use after GGC: 96094k -> 96093k
    Maximum of released memory in single GGC run: 18613k
    Garbage: 541485k -> 540713k
    Leak: 49722k -> 49722k
    Overhead: 40191k -> 40165k
    GGC runs: 638

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 134136k
    Peak memory use before GGC: 81628k
    Peak memory use after GGC: 58507k
    Maximum of released memory in single GGC run: 45493k -> 45492k
    Garbage: 143524k -> 143523k
    Leak: 7142k
    Overhead: 25104k -> 25103k
    GGC runs: 87

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 424496k
    Peak memory use before GGC: 201177k
    Peak memory use after GGC: 196173k
    Maximum of released memory in single GGC run: 95153k
    Garbage: 272370k -> 272369k
    Leak: 47195k
    Overhead: 30026k -> 30026k
    GGC runs: 105

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 345276k
    Peak memory use before GGC: 208293k
    Peak memory use after GGC: 196536k
    Maximum of released memory in single GGC run: 96535k
    Garbage: 388087k -> 388086k
    Leak: 47779k
    Overhead: 47627k -> 47627k
    GGC runs: 111

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 536244k
    Peak memory use before GGC: 314603k
    Peak memory use after GGC: 292947k
    Maximum of released memory in single GGC run: 163427k
    Garbage: 487440k -> 487439k
    Leak: 65111k
    Overhead: 58883k -> 58883k
    GGC runs: 100

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-08-31 13:47:28.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-09-01 01:10:29.000000000 +0000
@@ -1,3 +1,25 @@
+2006-08-31  Josh Conner  <jconner@apple.com>
+
+	PR c++/25505
+	* tree-gimple.c (is_gimple_mem_rhs): Recognize functions
+	returning aggregates.
+
+2006-08-31  Zdenek Dvorak <dvorakz@suse.cz>
+
+	PR tree-optimization/28839
+	* tree-into-ssa.c (prune_unused_phi_nodes): Take into account kills in
+	blocks in that phi arguments appear.
+
+2006-08-31  Roger Sayle  <roger@eyesopen.com>
+
+	PR other/22313
+	* dwarf2out.c (add_fde_cfi): Use a set_loc if the current label is
+	NULL, otherwise use an advance_loc4 to adjust relative to the 
+	current label.
+	(output_cfi) <DW_CFA_set_loc>: Update the current label.
+	(dwarf2out_switch_text_section): Reset the current label to avoid
+	using advance_loc4 over section boundaries.
+
 2006-08-31  Andreas Krebbel  <krebbel1@de.ibm.com>
 
 	PR target/24367


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