A recent patch increased GCC's memory consumption!

gcctest@suse.de gcctest@suse.de
Mon Feb 4 11:47:00 GMT 2008


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 empty function compilation at -O0 level:
    Overall memory needed: 8152k
    Peak memory use before GGC: 1096k
    Peak memory use after GGC: 994k
    Maximum of released memory in single GGC run: 129k
    Garbage: 237k
    Leak: 951k
    Overhead: 80k
    GGC runs: 2
Testing has produced no results
Testing has produced no results

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8168k
    Peak memory use before GGC: 1123k
    Peak memory use after GGC: 1021k
    Maximum of released memory in single GGC run: 131k
    Garbage: 239k
    Leak: 984k
    Overhead: 84k
    GGC runs: 3
Testing has produced no results
Testing has produced no results

comparing empty function compilation at -O1 level:
    Overall memory needed: 8212k
    Peak memory use before GGC: 1096k
    Peak memory use after GGC: 994k
    Maximum of released memory in single GGC run: 131k
    Garbage: 239k
    Leak: 952k
    Overhead: 81k
    GGC runs: 2
    Pre-IPA-Garbage: 226k
    Pre-IPA-Leak: 954k
    Pre-IPA-Overhead: 79k
    Post-IPA-Garbage: 226k
    Post-IPA-Leak: 954k
    Post-IPA-Overhead: 79k

comparing empty function compilation at -O2 level:
    Overall memory needed: 8232k
    Peak memory use before GGC: 1096k
    Peak memory use after GGC: 994k
    Maximum of released memory in single GGC run: 134k
    Garbage: 243k
    Leak: 953k
    Overhead: 81k
    GGC runs: 2
    Pre-IPA-Garbage: 226k
    Pre-IPA-Leak: 955k
    Pre-IPA-Overhead: 79k
    Post-IPA-Garbage: 226k
    Post-IPA-Leak: 955k
    Post-IPA-Overhead: 79k

comparing empty function compilation at -O3 level:
    Overall memory needed: 8232k
    Peak memory use before GGC: 1096k
    Peak memory use after GGC: 994k
    Maximum of released memory in single GGC run: 134k
    Garbage: 243k
    Leak: 953k
    Overhead: 81k
    GGC runs: 2
    Pre-IPA-Garbage: 226k
    Pre-IPA-Leak: 955k
    Pre-IPA-Overhead: 79k
    Post-IPA-Garbage: 226k
    Post-IPA-Leak: 955k
    Post-IPA-Overhead: 79k

comparing combine.c compilation at -O0 level:
    Overall memory needed: 22704k
    Peak memory use before GGC: 7809k
    Peak memory use after GGC: 7186k
    Maximum of released memory in single GGC run: 1550k
    Garbage: 37949k
    Leak: 5506k
    Overhead: 4649k
    GGC runs: 371
Testing has produced no results
Testing has produced no results

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 24708k
    Peak memory use before GGC: 9648k
    Peak memory use after GGC: 8954k
    Maximum of released memory in single GGC run: 1838k
    Garbage: 38291k
    Leak: 8380k
    Overhead: 5276k
    GGC runs: 342
Testing has produced no results
Testing has produced no results

comparing combine.c compilation at -O1 level:
    Overall memory needed: 32916k
    Peak memory use before GGC: 16345k
    Peak memory use after GGC: 16161k
    Maximum of released memory in single GGC run: 1362k
    Garbage: 51465k
    Leak: 5660k
    Overhead: 5782k
    GGC runs: 443
    Pre-IPA-Garbage: 13923k
    Pre-IPA-Leak: 17182k
    Pre-IPA-Overhead: 2129k
    Post-IPA-Garbage: 13923k
    Post-IPA-Leak: 17182k
    Post-IPA-Overhead: 2129k

comparing combine.c compilation at -O2 level:
    Overall memory needed: 35776k
    Peak memory use before GGC: 16446k
    Peak memory use after GGC: 16280k
    Maximum of released memory in single GGC run: 1316k
    Garbage: 71112k
    Leak: 5985k
    Overhead: 8062k
    GGC runs: 512
    Pre-IPA-Garbage: 14080k
    Pre-IPA-Leak: 17247k
    Pre-IPA-Overhead: 2144k
    Post-IPA-Garbage: 14080k
    Post-IPA-Leak: 17247k
    Post-IPA-Overhead: 2144k

comparing combine.c compilation at -O3 level:
    Overall memory needed: 39040k
    Peak memory use before GGC: 16623k
    Peak memory use after GGC: 16301k
    Maximum of released memory in single GGC run: 2063k
    Garbage: 93114k
    Leak: 6109k
    Overhead: 10685k
    GGC runs: 546
    Pre-IPA-Garbage: 14086k
    Pre-IPA-Leak: 17267k
    Pre-IPA-Overhead: 2146k
    Post-IPA-Garbage: 14086k
    Post-IPA-Leak: 17267k
    Post-IPA-Overhead: 2146k

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 137440k
    Peak memory use before GGC: 56999k
    Peak memory use after GGC: 31456k
    Maximum of released memory in single GGC run: 33256k
    Garbage: 128624k
    Leak: 8382k
    Overhead: 14368k
    GGC runs: 293
Testing has produced no results
Testing has produced no results

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 138696k -> 138700k
    Peak memory use before GGC: 58141k
    Peak memory use after GGC: 32598k
    Maximum of released memory in single GGC run: 33256k
    Garbage: 128862k
    Leak: 10057k
    Overhead: 14724k
    GGC runs: 289
Testing has produced no results
Testing has produced no results

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 143000k -> 143012k
    Peak memory use before GGC: 56211k
    Peak memory use after GGC: 49983k
    Maximum of released memory in single GGC run: 23976k
    Garbage: 206434k
    Leak: 9275k
    Overhead: 24742k
    GGC runs: 315
    Pre-IPA-Garbage: 50355k
    Pre-IPA-Leak: 49676k
    Pre-IPA-Overhead: 7543k
    Post-IPA-Garbage: 50355k
    Post-IPA-Leak: 49676k
    Post-IPA-Overhead: 7543k

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 184492k -> 184488k
    Peak memory use before GGC: 56850k
    Peak memory use after GGC: 51570k
    Maximum of released memory in single GGC run: 22370k
    Garbage: 246629k
    Leak: 10362k
    Overhead: 30342k
    GGC runs: 346
    Pre-IPA-Garbage: 50427k
    Pre-IPA-Leak: 49680k
    Pre-IPA-Overhead: 7550k
    Post-IPA-Garbage: 50427k
    Post-IPA-Leak: 49680k
    Post-IPA-Overhead: 7550k

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 190676k -> 190708k
    Peak memory use before GGC: 68033k
    Peak memory use after GGC: 62277k
    Maximum of released memory in single GGC run: 22870k
    Garbage: 274492k
    Leak: 10399k
    Overhead: 32131k
    GGC runs: 348
    Pre-IPA-Garbage: 50427k
    Pre-IPA-Leak: 49680k
    Pre-IPA-Overhead: 7550k
    Post-IPA-Garbage: 50427k
    Post-IPA-Leak: 49680k
    Post-IPA-Overhead: 7550k

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 149504k -> 148872k
    Peak memory use before GGC: 84844k -> 84550k
    Peak memory use after GGC: 84004k -> 83712k
    Maximum of released memory in single GGC run: 17148k -> 17020k
    Garbage: 201068k -> 200464k
    Leak: 48167k -> 48051k
    Overhead: 24077k -> 24006k
    GGC runs: 417 -> 415
    Pre-IPA-Garbage: 109656k -> 109338k
    Pre-IPA-Leak: 71354k -> 71179k
    Pre-IPA-Overhead: 12149k -> 12114k
    Post-IPA-Garbage: 109656k -> 109338k
    Post-IPA-Leak: 71354k -> 71179k
    Post-IPA-Overhead: 12149k -> 12114k

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
  Peak amount of GGC memory allocated before garbage collecting increased from 96057k to 96218k, overall 0.17%
  Peak amount of GGC memory still allocated after garbage collecting increased from 95106k to 95252k, overall 0.15%
    Overall memory needed: 169404k -> 169436k
    Peak memory use before GGC: 96057k -> 96218k
    Peak memory use after GGC: 95106k -> 95252k
    Maximum of released memory in single GGC run: 17205k -> 17531k
    Garbage: 206714k -> 206108k
    Leak: 69892k -> 69733k
    Overhead: 29063k -> 28984k
    GGC runs: 391 -> 390
    Pre-IPA-Garbage: 110300k -> 109981k
    Pre-IPA-Leak: 84635k -> 84460k
    Pre-IPA-Overhead: 14725k -> 14690k
    Post-IPA-Garbage: 110300k -> 109981k
    Post-IPA-Leak: 84635k -> 84460k
    Post-IPA-Overhead: 14725k -> 14690k

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 123391k -> 122843k
    Peak memory use before GGC: 84646k -> 84180k
    Peak memory use after GGC: 83795k -> 83345k
    Maximum of released memory in single GGC run: 16325k -> 16205k
    Garbage: 290787k -> 289904k
    Leak: 47413k -> 47317k
    Overhead: 29426k -> 29348k
    GGC runs: 514 -> 515
    Pre-IPA-Garbage: 155072k -> 154554k
    Pre-IPA-Leak: 88460k -> 87983k
    Pre-IPA-Overhead: 17597k -> 17518k
    Post-IPA-Garbage: 155072k -> 154554k
    Post-IPA-Leak: 88460k -> 87983k
    Post-IPA-Overhead: 17597k -> 17518k

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 124339k -> 123791k
    Peak memory use before GGC: 84892k -> 84422k
    Peak memory use after GGC: 83977k -> 83547k
    Maximum of released memory in single GGC run: 16363k -> 16207k
    Garbage: 358720k -> 357513k
    Leak: 48361k -> 48258k
    Overhead: 36471k -> 36368k
    GGC runs: 588
    Pre-IPA-Garbage: 158420k -> 157912k
    Pre-IPA-Leak: 88594k -> 88091k
    Pre-IPA-Overhead: 17949k -> 17868k
    Post-IPA-Garbage: 158420k -> 157912k
    Post-IPA-Leak: 88594k -> 88091k
    Post-IPA-Overhead: 17949k -> 17868k

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 126967k -> 126319k
    Peak memory use before GGC: 86076k -> 85602k
    Peak memory use after GGC: 85212k -> 84737k
    Maximum of released memory in single GGC run: 16722k -> 16586k
    Garbage: 385451k -> 384877k
    Leak: 48969k -> 48864k
    Overhead: 38675k -> 38624k
    GGC runs: 620 -> 616
    Pre-IPA-Garbage: 161224k -> 160703k
    Pre-IPA-Leak: 88874k -> 88371k
    Pre-IPA-Overhead: 18203k -> 18122k
    Post-IPA-Garbage: 161224k -> 160703k
    Post-IPA-Leak: 88874k -> 88371k
    Post-IPA-Overhead: 18203k -> 18122k

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 380436k -> 380432k
    Peak memory use before GGC: 101209k
    Peak memory use after GGC: 56862k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 178951k
    Leak: 6098k
    Overhead: 30783k
    GGC runs: 106
Testing has produced no results
Testing has produced no results

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 381236k
    Peak memory use before GGC: 101839k
    Peak memory use after GGC: 57493k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179066k
    Leak: 7828k
    Overhead: 31215k
    GGC runs: 111
Testing has produced no results
Testing has produced no results

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 438356k -> 438824k
    Peak memory use before GGC: 78857k
    Peak memory use after GGC: 70436k
    Maximum of released memory in single GGC run: 37753k
    Garbage: 234534k
    Leak: 16073k
    Overhead: 35581k
    GGC runs: 105
    Pre-IPA-Garbage: 52924k
    Pre-IPA-Leak: 49245k
    Pre-IPA-Overhead: 7121k
    Post-IPA-Garbage: 52924k
    Post-IPA-Leak: 49245k
    Post-IPA-Overhead: 7121k

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 359812k -> 359808k
    Peak memory use before GGC: 75423k
    Peak memory use after GGC: 70437k
    Maximum of released memory in single GGC run: 32251k
    Garbage: 245332k
    Leak: 16245k
    Overhead: 38769k
    GGC runs: 116
    Pre-IPA-Garbage: 91836k
    Pre-IPA-Leak: 77290k
    Pre-IPA-Overhead: 11793k
    Post-IPA-Garbage: 91836k
    Post-IPA-Leak: 77290k
    Post-IPA-Overhead: 11793k

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1197520k -> 1197928k
    Peak memory use before GGC: 136584k
    Peak memory use after GGC: 127942k
    Maximum of released memory in single GGC run: 59911k
    Garbage: 371518k
    Leak: 24376k
    Overhead: 49888k
    GGC runs: 103
    Pre-IPA-Garbage: 91836k
    Pre-IPA-Leak: 77290k
    Pre-IPA-Overhead: 11793k
    Post-IPA-Garbage: 91836k
    Post-IPA-Leak: 77290k
    Post-IPA-Overhead: 11793k

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2008-02-03 00:42:53.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2008-02-04 08:38:41.000000000 +0000
@@ -1,3 +1,15 @@
+2008-02-03  Jason Merrill  <jason@redhat.com>
+
+	* print-tree.c (print_node) [CONSTRUCTOR]: Print elements.
+
+2008-02-04  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	PR other/29972
+	* doc/invoke.texi (C++ Dialect Options, Optimize Options)
+	(HPPA Options, i386 and x86-64 Options, IA-64 Options)
+	(RS/6000 and PowerPC Options): Fix typos and markup.
+	* doc/passes.texi (Tree-SSA passes): Likewise.
+
 2008-02-02  Michael Matz  <matz@suse.de>
 
 	PR target/35045
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2008-02-01 00:47:53.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2008-02-04 08:38:41.000000000 +0000
@@ -1,3 +1,28 @@
+2008-02-02  Jason Merrill  <jason@redhat.com>
+	    Mark Mitchell  <mark@codesourcery.com>
+
+	PR c++/33916
+	* init.c (build_value_init_1): New function.
+	(build_value_init): New function.
+	* typeck2.c (build_functional_cast): Call it.
+	* cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
+
+	* cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from 
+	TYPE_HAS_CONSTRUCTOR.
+	* class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
+	add_implicitly_declared_members): Adjust.
+	(check_field_decls): Adjust. Remove warnings about reference/const
+	in class without constructor.
+	(check_bases_and_members): Adjust.  Give those warnings here instead.
+	* decl.c (fixup_anonymous_aggr): Adjust.
+	(check_initializer): Adjust, clarify logic slightly.
+	(grok_special_member_properties): Adjust, only set if user-provided.
+	* rtti.c (create_tinfo_types): Don't set.
+	* cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
+	Use same_type_ignoring_top_level_qualifiers_p.
+	* pt.c (check_explicit_specialization): Adjust.
+	(instantiate_class_template): Adjust.
+
 2008-01-31  Douglas Gregor  <doug.gregor@gmail.com>
            Jakub Jelinek  <jakub@redhat.com>
 


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