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 combine.c compilation at -O0 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 9160k to 9174k, overall 0.15%
  Peak amount of GGC memory still allocated after garbage collectin increased from 8547k to 8562k, overall 0.18%
    Overall memory needed: 24725k -> 24741k
    Peak memory use before GGC: 9160k -> 9174k
    Peak memory use after GGC: 8547k -> 8562k
    Maximum of released memory in single GGC run: 2580k
    Garbage: 38212k -> 38209k
    Leak: 6052k -> 6051k
    Overhead: 5326k -> 5326k
    GGC runs: 307

comparing combine.c compilation at -O1 level:
    Overall memory needed: 36145k
    Peak memory use before GGC: 16999k -> 16997k
    Peak memory use after GGC: 16828k -> 16826k
    Maximum of released memory in single GGC run: 2265k -> 2264k
    Garbage: 56481k -> 56481k
    Leak: 6076k -> 6067k
    Overhead: 6060k -> 6060k
    GGC runs: 378

comparing combine.c compilation at -O2 level:
    Overall memory needed: 26496k
    Peak memory use before GGC: 16997k -> 16996k
    Peak memory use after GGC: 16828k -> 16826k
    Maximum of released memory in single GGC run: 2261k -> 2254k
    Garbage: 80121k -> 80117k
    Leak: 6170k -> 6168k
    Overhead: 8576k -> 8576k
    GGC runs: 446

comparing combine.c compilation at -O3 level:
    Overall memory needed: 25600k -> 25596k
    Peak memory use before GGC: 18088k -> 18086k
    Peak memory use after GGC: 17424k -> 17423k
    Maximum of released memory in single GGC run: 3321k
    Garbage: 109572k -> 109572k
    Leak: 6243k -> 6242k
    Overhead: 11849k
    GGC runs: 492

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 81376k
    Peak memory use before GGC: 68248k -> 68247k
    Peak memory use after GGC: 43996k -> 43995k
    Maximum of released memory in single GGC run: 35708k
    Garbage: 138282k -> 138277k
    Leak: 9116k -> 9115k
    Overhead: 18991k -> 18991k
    GGC runs: 241

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 102556k -> 102544k
    Peak memory use before GGC: 83523k -> 83522k
    Peak memory use after GGC: 77616k -> 77615k
    Maximum of released memory in single GGC run: 31804k
    Garbage: 268177k -> 268166k
    Leak: 8929k -> 8928k
    Overhead: 29922k
    GGC runs: 235

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 103604k -> 105372k
    Peak memory use before GGC: 87820k -> 87819k
    Peak memory use after GGC: 79916k -> 79915k
    Maximum of released memory in single GGC run: 30384k
    Garbage: 314592k -> 314581k
    Leak: 8935k -> 8934k
    Overhead: 36939k
    GGC runs: 263

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 103628k -> 105392k
    Peak memory use before GGC: 87847k -> 87846k
    Peak memory use after GGC: 79942k -> 79941k
    Maximum of released memory in single GGC run: 30575k
    Garbage: 315188k -> 315175k
    Leak: 8938k -> 8937k
    Overhead: 37118k -> 37118k
    GGC runs: 267

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 116504k -> 116500k
    Peak memory use before GGC: 92791k
    Peak memory use after GGC: 91868k
    Maximum of released memory in single GGC run: 19688k -> 19687k
    Garbage: 214070k -> 214069k
    Leak: 47149k -> 47151k
    Overhead: 22165k -> 22165k
    GGC runs: 416

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 114912k -> 114944k
    Peak memory use before GGC: 97241k -> 97242k
    Peak memory use after GGC: 95100k -> 95101k
    Maximum of released memory in single GGC run: 18447k
    Garbage: 447356k -> 447375k
    Leak: 49095k -> 49096k
    Overhead: 32311k -> 32311k
    GGC runs: 561 -> 562

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 114940k -> 114944k
    Peak memory use before GGC: 97243k
    Peak memory use after GGC: 95101k -> 95102k
    Maximum of released memory in single GGC run: 18448k -> 18447k
    Garbage: 531985k -> 531991k
    Leak: 49805k -> 49807k
    Overhead: 40173k -> 40172k
    GGC runs: 642 -> 641

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 117280k -> 117332k
    Peak memory use before GGC: 98676k -> 98677k
    Peak memory use after GGC: 96381k -> 96383k
    Maximum of released memory in single GGC run: 18759k
    Garbage: 552861k -> 552879k
    Leak: 50124k -> 50126k
    Overhead: 41359k -> 41363k
    GGC runs: 652

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 146456k
    Peak memory use before GGC: 95412k
    Peak memory use after GGC: 58507k
    Maximum of released memory in single GGC run: 45493k
    Garbage: 163295k -> 163295k
    Leak: 7142k -> 7142k
    Overhead: 29023k
    GGC runs: 87

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

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 350296k
    Peak memory use before GGC: 208293k
    Peak memory use after GGC: 196536k
    Maximum of released memory in single GGC run: 101565k
    Garbage: 394891k -> 394891k
    Leak: 47778k -> 47778k
    Overhead: 49054k
    GGC runs: 111

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 781364k
    Peak memory use before GGC: 314602k
    Peak memory use after GGC: 292946k
    Maximum of released memory in single GGC run: 163430k
    Garbage: 494953k -> 494953k
    Leak: 65110k -> 65110k
    Overhead: 60330k
    GGC runs: 100

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-08-13 19:14:12.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-08-14 07:54:13.000000000 +0000
@@ -1,3 +1,18 @@
+2006-08-13  Alexandre Oliva  <aoliva@redhat.com>
+	    Andrew Pinski  <pinskia@physics.uc.edu>
+
+	PR c/27184
+	* tree.c (build_array_type): Unify array types with
+	unspecified index_type.
+	* c-decl.c (grokdeclarator): Make sure we do not modify a
+	unified incomplete array type.
+	* c-typeck.c (store_init_value): Create distinct type before
+	filling in the index type in an initializer from a compound
+	literal.
+
+	* c-decl.c (grokdeclarator): Remove code where we copy the
+	array type over.
+
 2006-08-13  Andrew Pinski  <pinskia@physics.uc.edu>
 
 	* tree-pass.h (TODO_update_ssa): Fix which bit is used to take


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]