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 in some cases!


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 -> 444k
    Leak: 2288k -> 2289k
    Overhead: 455k -> 456k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7400k
    Peak memory use before GGC: 2291k -> 2292k
    Peak memory use after GGC: 1982k
    Maximum of released memory in single GGC run: 309k -> 310k
    Garbage: 447k -> 447k
    Leak: 2320k -> 2321k
    Overhead: 460k -> 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: 450k -> 451k
    Leak: 2291k -> 2291k
    Overhead: 456k -> 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 -> 454k
    Leak: 2291k -> 2291k
    Overhead: 456k -> 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 -> 454k
    Leak: 2291k -> 2291k
    Overhead: 456k -> 457k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 17664k -> 17616k
    Peak memory use before GGC: 9337k -> 9322k
    Peak memory use after GGC: 8889k -> 8885k
    Maximum of released memory in single GGC run: 2628k -> 2627k
    Garbage: 37296k -> 37251k
    Leak: 6545k -> 6539k
    Overhead: 4831k -> 4643k
    GGC runs: 276 -> 280

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 19716k -> 19704k
    Peak memory use before GGC: 10920k -> 10916k
    Peak memory use after GGC: 10549k -> 10545k
    Maximum of released memory in single GGC run: 2388k
    Garbage: 37887k -> 37851k
    Leak: 9421k -> 9415k
    Overhead: 5532k -> 5346k
    GGC runs: 272 -> 271

comparing combine.c compilation at -O1 level:
  Ovarall memory allocated via mmap and sbrk decreased from 34540k to 33032k, overall -4.57%
    Overall memory needed: 34540k -> 33032k
    Peak memory use before GGC: 19926k -> 19645k
    Peak memory use after GGC: 19728k -> 19446k
    Maximum of released memory in single GGC run: 2261k
    Garbage: 55011k -> 54611k
    Leak: 6568k -> 6569k
    Overhead: 9903k -> 9667k
    GGC runs: 348 -> 352

comparing combine.c compilation at -O2 level:
  Ovarall memory allocated via mmap and sbrk decreased from 38028k to 36512k, overall -4.15%
    Overall memory needed: 38028k -> 36512k
    Peak memory use before GGC: 19937k -> 19649k
    Peak memory use after GGC: 19736k -> 19454k
    Maximum of released memory in single GGC run: 2203k -> 2202k
    Garbage: 70936k -> 70388k
    Leak: 6681k -> 6682k
    Overhead: 11767k -> 11477k
    GGC runs: 406 -> 410

comparing combine.c compilation at -O3 level:
    Overall memory needed: 47960k -> 47456k
    Peak memory use before GGC: 21061k -> 20775k
    Peak memory use after GGC: 20202k -> 19929k
    Maximum of released memory in single GGC run: 3163k
    Garbage: 104301k -> 103524k
    Leak: 6762k -> 6763k
    Overhead: 16725k -> 16310k
    GGC runs: 461 -> 462

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 105528k -> 104736k
    Peak memory use before GGC: 71146k -> 70357k
    Peak memory use after GGC: 45192k -> 45189k
    Maximum of released memory in single GGC run: 37769k -> 37701k
    Garbage: 131557k -> 131189k
    Leak: 9583k -> 9580k
    Overhead: 16627k -> 15666k
    GGC runs: 208

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 106912k -> 106120k
    Peak memory use before GGC: 72307k -> 71519k
    Peak memory use after GGC: 46459k -> 46457k
    Maximum of released memory in single GGC run: 37769k -> 37702k
    Garbage: 132721k -> 132350k
    Leak: 11272k -> 11270k
    Overhead: 17021k -> 16060k
    GGC runs: 207 -> 206

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 125256k -> 123872k
    Peak memory use before GGC: 72958k -> 71508k
    Peak memory use after GGC: 69151k -> 67853k
    Maximum of released memory in single GGC run: 31661k
    Garbage: 229868k -> 227098k
    Leak: 9398k -> 9400k
    Overhead: 29468k -> 28095k
    GGC runs: 224

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 191252k -> 192136k
    Peak memory use before GGC: 79783k -> 78337k
    Peak memory use after GGC: 74013k -> 72716k
    Maximum of released memory in single GGC run: 30527k -> 30526k
    Garbage: 280985k -> 277942k
    Leak: 9395k -> 9397k
    Overhead: 35772k -> 34309k
    GGC runs: 246

comparing insn-attrtab.c compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 186436k to 192148k, overall 3.06%
    Overall memory needed: 186436k -> 192148k
    Peak memory use before GGC: 79796k -> 78349k
    Peak memory use after GGC: 74026k -> 72729k
    Maximum of released memory in single GGC run: 30597k -> 30596k
    Garbage: 281705k -> 278669k
    Leak: 9397k -> 9399k
    Overhead: 35982k -> 34519k
    GGC runs: 246

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Amount of produced GGC garbage increased from 208371k to 209166k, overall 0.38%
  Amount of memory still referenced at the end of compilation increased from 49079k to 49262k, overall 0.37%
    Overall memory needed: 152267k -> 151631k
    Peak memory use before GGC: 93134k -> 92618k
    Peak memory use after GGC: 92212k -> 91701k
    Maximum of released memory in single GGC run: 18949k -> 18916k
    Garbage: 208371k -> 209166k
    Leak: 49079k -> 49262k
    Overhead: 21256k -> 21473k
    GGC runs: 407 -> 409

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
  Amount of produced GGC garbage increased from 214942k to 215792k, overall 0.40%
  Amount of memory still referenced at the end of compilation increased from 72503k to 72687k, overall 0.25%
    Overall memory needed: 169783k -> 169735k
    Peak memory use before GGC: 105410k -> 105241k
    Peak memory use after GGC: 104366k -> 104198k
    Maximum of released memory in single GGC run: 18788k -> 19093k
    Garbage: 214942k -> 215792k
    Leak: 72503k -> 72687k
    Overhead: 27159k -> 27396k
    GGC runs: 382 -> 383

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 50001k to 50202k, overall 0.40%
    Overall memory needed: 139489k -> 138161k
    Peak memory use before GGC: 98490k -> 98469k
    Peak memory use after GGC: 97488k -> 97467k
    Maximum of released memory in single GGC run: 17979k -> 18086k
    Garbage: 401548k -> 401813k
    Leak: 50001k -> 50202k
    Overhead: 55153k -> 55484k
    GGC runs: 548 -> 545

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 50799k to 50999k, overall 0.40%
    Overall memory needed: 141453k -> 140117k
    Peak memory use before GGC: 98529k -> 98508k
    Peak memory use after GGC: 97553k -> 97532k
    Maximum of released memory in single GGC run: 17979k -> 18077k
    Garbage: 459721k -> 459563k
    Leak: 50799k -> 50999k
    Overhead: 48325k -> 48510k
    GGC runs: 598 -> 596

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of memory still referenced at the end of compilation increased from 51414k to 51670k, overall 0.50%
    Overall memory needed: 144225k -> 142865k
    Peak memory use before GGC: 100283k -> 100219k
    Peak memory use after GGC: 99240k -> 99222k
    Maximum of released memory in single GGC run: 18336k -> 18473k
    Garbage: 487226k -> 487014k
    Leak: 51414k -> 51670k
    Overhead: 50299k -> 50501k
    GGC runs: 614 -> 613

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 246452k -> 246444k
    Peak memory use before GGC: 82630k
    Peak memory use after GGC: 59510k
    Maximum of released memory in single GGC run: 45582k
    Garbage: 148155k -> 148155k
    Leak: 8080k -> 8081k
    Overhead: 25066k -> 24863k
    GGC runs: 80

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 247348k -> 247352k
    Peak memory use before GGC: 83276k
    Peak memory use after GGC: 60156k
    Maximum of released memory in single GGC run: 45231k
    Garbage: 148325k -> 148386k
    Leak: 9336k -> 9336k
    Overhead: 25561k -> 25359k
    GGC runs: 88

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 27473k to 28011k, overall 1.96%
    Overall memory needed: 315332k -> 312156k
    Peak memory use before GGC: 197757k -> 195999k
    Peak memory use after GGC: 178756k -> 176840k
    Maximum of released memory in single GGC run: 134210k -> 132183k
    Garbage: 274307k -> 270497k
    Leak: 27473k -> 28011k
    Overhead: 33210k -> 32233k
    GGC runs: 74

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 27902k to 28440k, overall 1.93%
    Overall memory needed: 301876k -> 297420k
    Peak memory use before GGC: 302461k -> 302730k
    Peak memory use after GGC: 178747k -> 176830k
    Maximum of released memory in single GGC run: 241049k
    Garbage: 586865k -> 583054k
    Leak: 27902k -> 28440k
    Overhead: 95381k -> 94404k
    GGC runs: 83

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Amount of memory still referenced at the end of compilation increased from 48594k to 50425k, overall 3.77%
    Overall memory needed: 1414084k -> 1412120k
    Peak memory use before GGC: 283520k -> 280853k
    Peak memory use after GGC: 276538k -> 273871k
    Maximum of released memory in single GGC run: 138347k -> 114236k
    Garbage: 451542k -> 446067k
    Leak: 48594k -> 50425k
    Overhead: 56810k -> 55125k
    GGC runs: 73 -> 74

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-01-20 18:28:26.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-01-21 04:30:58.000000000 +0000
@@ -1,3 +1,18 @@
+2007-01-20  Roger Sayle  <roger@eyesopen.com>
+	    Joseph Myers  <joseph@codesourcery.com>
+
+	* doc/invoke.texi (-fdump-rtl-combine): Fix under/overfull hbox.
+	(-fdump-rtl-stack): Likewise.
+	(-fno-signed-zeros): Use @minus{} for a minus sign.  Correct typo.
+	(-mcheck-zero-division, -mcpu): Fix under/overfull hbox.
+	(-mpt-fixed): Use @minus{} for minus sign.
+	(Using Precompiled Headers): Fix under/overfull hbox.
+
+2007-01-20  Jan Hubicka  <jh@suse.cz>
+
+	* tree-flow.h (struct stmt_ann_d): Move references_memory to proper
+	place within annotation.
+
 2007-01-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
 	* pa.c (output_move_double): Change array size of xoperands to 4.


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]