This is the mail archive of the gcc-regression@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A recent patch increased GCC's memory consumption!


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: 7384k
    Peak memory use before GGC: 2264k
    Peak memory use after GGC: 1955k
    Maximum of released memory in single GGC run: 309k
    Garbage: 444k
    Leak: 2289k
    Overhead: 456k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7400k
    Peak memory use before GGC: 2292k
    Peak memory use after GGC: 1982k
    Maximum of released memory in single GGC run: 310k
    Garbage: 447k
    Leak: 2321k
    Overhead: 460k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 7492k
    Peak memory use before GGC: 2264k
    Peak memory use after GGC: 1955k
    Maximum of released memory in single GGC run: 309k
    Garbage: 451k
    Leak: 2291k
    Overhead: 456k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 7504k
    Peak memory use before GGC: 2265k
    Peak memory use after GGC: 1955k
    Maximum of released memory in single GGC run: 310k
    Garbage: 454k
    Leak: 2291k
    Overhead: 457k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 7504k
    Peak memory use before GGC: 2265k
    Peak memory use after GGC: 1955k
    Maximum of released memory in single GGC run: 310k
    Garbage: 454k
    Leak: 2291k
    Overhead: 457k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
  Amount of produced GGC garbage increased from 37251k to 37290k, overall 0.11%
    Overall memory needed: 17616k -> 17812k
    Peak memory use before GGC: 9322k -> 9328k
    Peak memory use after GGC: 8885k -> 8891k
    Maximum of released memory in single GGC run: 2627k -> 2633k
    Garbage: 37251k -> 37290k
    Leak: 6539k -> 6539k
    Overhead: 4643k -> 4654k
    GGC runs: 280

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 19704k -> 19716k
    Peak memory use before GGC: 10916k -> 10917k
    Peak memory use after GGC: 10545k -> 10551k
    Maximum of released memory in single GGC run: 2388k -> 2393k
    Garbage: 37851k -> 37860k
    Leak: 9415k -> 9415k
    Overhead: 5346k -> 5357k
    GGC runs: 271

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 54612k to 54707k, overall 0.17%
    Overall memory needed: 33000k -> 33008k
    Peak memory use before GGC: 19645k -> 19646k
    Peak memory use after GGC: 19446k
    Maximum of released memory in single GGC run: 2261k -> 2266k
    Garbage: 54612k -> 54707k
    Leak: 6569k -> 6570k
    Overhead: 9667k -> 9682k
    GGC runs: 352

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 70393k to 70486k, overall 0.13%
    Overall memory needed: 36512k -> 36516k
    Peak memory use before GGC: 19650k
    Peak memory use after GGC: 19454k
    Maximum of released memory in single GGC run: 2203k -> 2206k
    Garbage: 70393k -> 70486k
    Leak: 6681k -> 6681k
    Overhead: 11478k -> 11486k
    GGC runs: 410

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 103575k to 103719k, overall 0.14%
    Overall memory needed: 47452k -> 47456k
    Peak memory use before GGC: 20775k
    Peak memory use after GGC: 19929k -> 19927k
    Maximum of released memory in single GGC run: 3163k -> 3165k
    Garbage: 103575k -> 103719k
    Leak: 6763k -> 6769k
    Overhead: 16318k -> 16368k
    GGC runs: 462 -> 463

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 104740k
    Peak memory use before GGC: 70357k
    Peak memory use after GGC: 45189k
    Maximum of released memory in single GGC run: 37701k
    Garbage: 131189k -> 131191k
    Leak: 9580k
    Overhead: 15666k -> 15666k
    GGC runs: 208

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 106120k -> 106124k
    Peak memory use before GGC: 71519k
    Peak memory use after GGC: 46457k
    Maximum of released memory in single GGC run: 37702k
    Garbage: 132350k -> 132352k
    Leak: 11270k
    Overhead: 16060k -> 16061k
    GGC runs: 206

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 123856k -> 123928k
    Peak memory use before GGC: 71508k
    Peak memory use after GGC: 67853k
    Maximum of released memory in single GGC run: 31661k -> 31672k
    Garbage: 227099k -> 227207k
    Leak: 9400k -> 9399k
    Overhead: 28095k -> 28103k
    GGC runs: 224

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 192132k -> 187960k
    Peak memory use before GGC: 78337k
    Peak memory use after GGC: 72716k
    Maximum of released memory in single GGC run: 30526k -> 30537k
    Garbage: 278147k -> 278319k
    Leak: 9397k -> 9396k
    Overhead: 34350k -> 34361k
    GGC runs: 246

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 192148k -> 192884k
    Peak memory use before GGC: 78349k
    Peak memory use after GGC: 72729k
    Maximum of released memory in single GGC run: 30596k -> 30607k
    Garbage: 278874k -> 279046k
    Leak: 9399k -> 9398k
    Overhead: 34560k -> 34569k
    GGC runs: 246

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Amount of produced GGC garbage increased from 209166k to 209460k, overall 0.14%
    Overall memory needed: 151619k -> 151599k
    Peak memory use before GGC: 92618k
    Peak memory use after GGC: 91701k
    Maximum of released memory in single GGC run: 18916k
    Garbage: 209166k -> 209460k
    Leak: 49262k -> 49262k
    Overhead: 21473k -> 21551k
    GGC runs: 409

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
  Amount of produced GGC garbage increased from 215792k to 216087k, overall 0.14%
    Overall memory needed: 169731k -> 169779k
    Peak memory use before GGC: 105241k
    Peak memory use after GGC: 104198k
    Maximum of released memory in single GGC run: 19093k
    Garbage: 215792k -> 216087k
    Leak: 72687k -> 72687k
    Overhead: 27396k -> 27474k
    GGC runs: 383

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 137347k
    Peak memory use before GGC: 98365k
    Peak memory use after GGC: 97363k
    Maximum of released memory in single GGC run: 18086k
    Garbage: 390934k -> 391125k
    Leak: 50528k -> 50527k
    Overhead: 51993k -> 52032k
    GGC runs: 543

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 139199k
    Peak memory use before GGC: 98404k
    Peak memory use after GGC: 97429k
    Maximum of released memory in single GGC run: 18077k
    Garbage: 446268k -> 446548k
    Leak: 51291k -> 51291k
    Overhead: 46947k -> 47086k
    GGC runs: 593

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 141855k -> 141859k
    Peak memory use before GGC: 100102k
    Peak memory use after GGC: 99104k
    Maximum of released memory in single GGC run: 18473k
    Garbage: 469034k -> 469348k
    Leak: 51434k -> 51434k
    Overhead: 47553k -> 47685k
    GGC runs: 607

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 246455k -> 246463k
    Peak memory use before GGC: 82632k -> 82633k
    Peak memory use after GGC: 59512k -> 59515k
    Maximum of released memory in single GGC run: 45582k -> 45585k
    Garbage: 148107k -> 148110k
    Leak: 8083k -> 8083k
    Overhead: 24863k -> 24863k
    GGC runs: 80

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 247351k -> 247363k
    Peak memory use before GGC: 83278k -> 83279k
    Peak memory use after GGC: 60158k -> 60161k
    Maximum of released memory in single GGC run: 45231k -> 45230k
    Garbage: 148382k -> 148385k
    Leak: 9338k -> 9338k
    Overhead: 25359k -> 25359k
    GGC runs: 88

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 329204k -> 329200k
    Peak memory use before GGC: 201002k
    Peak memory use after GGC: 189198k
    Maximum of released memory in single GGC run: 135346k
    Garbage: 275765k
    Leak: 30235k
    Overhead: 31268k
    GGC runs: 74

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 302688k -> 302720k
    Peak memory use before GGC: 319046k
    Peak memory use after GGC: 189193k
    Maximum of released memory in single GGC run: 255677k
    Garbage: 606140k
    Leak: 30664k
    Overhead: 97140k
    GGC runs: 83

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1412064k -> 1412084k
    Peak memory use before GGC: 280855k
    Peak memory use after GGC: 273873k
    Maximum of released memory in single GGC run: 114236k
    Garbage: 446260k
    Leak: 50427k
    Overhead: 55164k
    GGC runs: 74

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-01-27 00:29:38.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-01-27 16:10:51.000000000 +0000
@@ -1,3 +1,25 @@
+2007-01-27  Steven Bosscher  <steven@gcc.gnu.org>
+
+	* tracer.c (rest_of_handle_tracer): We already cleaned
+	up the CFG in tracer() so don't do it here again.
+	* cfgcleanup.c (rest_of_handle_jump2): Don't repeat
+	cleanup_cfg here, either.  And don't call renumber_insns.
+
+	* cfgrtl.c (rtl_verify_flow_info_1): Don't verify that BB_END
+	and BB_HEAD are in the insn stream here.  Instead make sure
+	that BB_INSN is valid on all insns.  Also, do check here that
+	there are no pending branch predictions...
+	(rtl_verify_flow_info): ...instead of doing it here.  Checks
+	for BB_END and BB_HEAD moved from rtl_verify_flow_info_1 to
+	here.
+
+2007-01-26  Roger Sayle  <roger@eyesopen.com>
+
+	* config/i386/i386.c (ix86_swap_binary_operands_p): New helper
+	function to simplify/factorize operand order canonicalization.
+	(ix86_fixup_binary_operands): Reorganize using the above function.
+	(ix86_binary_operator_ok): Likewise.
+
 2007-01-27  Jakub Jelinek  <jakub@redhat.com>
 
 	* genattrtab.c (struct attr_value_list, insn_code_values): Move to


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]