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: 18277k
    Peak memory use before GGC: 2235k
    Peak memory use after GGC: 1942k
    Maximum of released memory in single GGC run: 293k
    Garbage: 423k
    Leak: 2273k
    Overhead: 446k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 18293k
    Peak memory use before GGC: 2263k
    Peak memory use after GGC: 1970k
    Maximum of released memory in single GGC run: 293k
    Garbage: 425k
    Leak: 2305k
    Overhead: 450k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18381k
    Peak memory use before GGC: 2235k
    Peak memory use after GGC: 1942k
    Maximum of released memory in single GGC run: 293k
    Garbage: 427k
    Leak: 2275k
    Overhead: 446k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18393k
    Peak memory use before GGC: 2236k
    Peak memory use after GGC: 1942k
    Maximum of released memory in single GGC run: 294k
    Garbage: 430k
    Leak: 2275k
    Overhead: 447k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18393k
    Peak memory use before GGC: 2236k
    Peak memory use after GGC: 1942k
    Maximum of released memory in single GGC run: 294k
    Garbage: 430k
    Leak: 2275k
    Overhead: 447k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28437k
    Peak memory use before GGC: 9287k
    Peak memory use after GGC: 8804k
    Maximum of released memory in single GGC run: 2641k
    Garbage: 37502k
    Leak: 6455k
    Overhead: 4869k
    GGC runs: 280

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 30521k
    Peak memory use before GGC: 10834k
    Peak memory use after GGC: 10464k
    Maximum of released memory in single GGC run: 2360k
    Garbage: 38077k
    Leak: 9331k
    Overhead: 5570k
    GGC runs: 272

comparing combine.c compilation at -O1 level:
    Overall memory needed: 29474k
    Peak memory use before GGC: 16979k
    Peak memory use after GGC: 16792k
    Maximum of released memory in single GGC run: 2254k
    Garbage: 55685k -> 55685k
    Leak: 6489k
    Overhead: 10562k
    GGC runs: 360

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29474k
    Peak memory use before GGC: 16988k
    Peak memory use after GGC: 16792k
    Maximum of released memory in single GGC run: 2611k
    Garbage: 71699k -> 71699k
    Leak: 6611k
    Overhead: 12536k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 29602k
    Peak memory use before GGC: 18226k
    Peak memory use after GGC: 17749k
    Maximum of released memory in single GGC run: 4564k
    Garbage: 106169k -> 106169k
    Leak: 6688k
    Overhead: 17998k
    GGC runs: 463

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 89650k
    Peak memory use before GGC: 71193k
    Peak memory use after GGC: 44699k
    Maximum of released memory in single GGC run: 37868k
    Garbage: 132105k
    Leak: 9518k
    Overhead: 16952k
    GGC runs: 211

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 90826k
    Peak memory use before GGC: 72354k
    Peak memory use after GGC: 45967k
    Maximum of released memory in single GGC run: 37868k
    Garbage: 133512k
    Leak: 10982k
    Overhead: 17347k
    GGC runs: 209

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 96050k
    Peak memory use before GGC: 73119k
    Peak memory use after GGC: 70764k
    Maximum of released memory in single GGC run: 31671k
    Garbage: 229861k
    Leak: 9343k
    Overhead: 31154k
    GGC runs: 226

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 128386k
    Peak memory use before GGC: 78731k
    Peak memory use after GGC: 76200k
    Maximum of released memory in single GGC run: 30216k
    Garbage: 282674k
    Leak: 9345k
    Overhead: 37707k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 118790k
    Peak memory use before GGC: 78756k
    Peak memory use after GGC: 76226k
    Maximum of released memory in single GGC run: 30410k
    Garbage: 283518k
    Leak: 9350k
    Overhead: 37940k
    GGC runs: 253

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119066k
    Peak memory use before GGC: 92331k
    Peak memory use after GGC: 91417k
    Maximum of released memory in single GGC run: 19252k
    Garbage: 210224k
    Leak: 48133k
    Overhead: 20979k
    GGC runs: 413

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 131642k
    Peak memory use before GGC: 104696k
    Peak memory use after GGC: 103652k
    Maximum of released memory in single GGC run: 18947k
    Garbage: 216791k
    Leak: 71564k
    Overhead: 26883k
    GGC runs: 384

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 120074k
    Peak memory use before GGC: 96747k -> 96748k
    Peak memory use after GGC: 94461k -> 94462k
    Maximum of released memory in single GGC run: 17941k
    Garbage: 442053k -> 442072k
    Leak: 50198k
    Overhead: 107726k -> 107727k
    GGC runs: 565

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 120134k
    Peak memory use before GGC: 96775k -> 96776k
    Peak memory use after GGC: 94489k -> 94490k
    Maximum of released memory in single GGC run: 18082k
    Garbage: 497118k -> 497136k
    Leak: 51167k
    Overhead: 63569k -> 63569k
    GGC runs: 621

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 121934k
    Peak memory use before GGC: 97763k -> 97765k
    Peak memory use after GGC: 96142k -> 96144k
    Maximum of released memory in single GGC run: 18476k
    Garbage: 517485k -> 517507k
    Leak: 51140k
    Overhead: 63491k -> 63491k
    GGC runs: 625

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137302k
    Peak memory use before GGC: 81587k
    Peak memory use after GGC: 58467k
    Maximum of released memory in single GGC run: 45167k
    Garbage: 148513k
    Leak: 7542k
    Overhead: 25327k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 138014k
    Peak memory use before GGC: 82233k
    Peak memory use after GGC: 59113k
    Maximum of released memory in single GGC run: 45232k
    Garbage: 148724k
    Leak: 9309k
    Overhead: 25823k
    GGC runs: 88

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 205546k to 205843k, overall 0.14%
  Peak amount of GGC memory still allocated after garbage collectin increased from 199777k to 200073k, overall 0.15%
  Amount of produced GGC garbage increased from 283522k to 283818k, overall 0.10%
    Overall memory needed: 428682k -> 428046k
    Peak memory use before GGC: 205546k -> 205843k
    Peak memory use after GGC: 199777k -> 200073k
    Maximum of released memory in single GGC run: 99746k -> 99748k
    Garbage: 283522k -> 283818k
    Leak: 29778k
    Overhead: 36217k
    GGC runs: 97

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 205539k to 205836k, overall 0.14%
  Peak amount of GGC memory still allocated after garbage collectin increased from 199770k to 200066k, overall 0.15%
    Overall memory needed: 355578k -> 355586k
    Peak memory use before GGC: 205539k -> 205836k
    Peak memory use after GGC: 199770k -> 200066k
    Maximum of released memory in single GGC run: 96117k -> 96120k
    Garbage: 364129k -> 364426k
    Leak: 30361k
    Overhead: 51967k
    GGC runs: 105

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Peak amount of GGC memory allocated before garbage collecting increased from 326891k to 327243k, overall 0.11%
  Peak amount of GGC memory still allocated after garbage collectin increased from 304533k to 304885k, overall 0.12%
    Overall memory needed: 769814k -> 769718k
    Peak memory use before GGC: 326891k -> 327243k
    Peak memory use after GGC: 304533k -> 304885k
    Maximum of released memory in single GGC run: 168269k -> 168283k
    Garbage: 504162k -> 504514k
    Leak: 45414k
    Overhead: 66989k
    GGC runs: 97

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-12-15 10:38:26.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-12-15 16:16:35.000000000 +0000
@@ -1,3 +1,9 @@
+2006-12-15  Andrew Pinski  <pinski@gmail.com>
+
+	PR tree-opt/30140
+	* tree-inline.c (setup_one_parameter): Gimplify the statement if
+	the variable is not a gimple register variable.
+
 2006-12-15  Uros Bizjak  <ubizjak@gmail.com>
 
 	* invoke.texi (mstringop-strategy): Add missing "byte_loop" value.


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]