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:
    Overall memory needed: 24781k
    Peak memory use before GGC: 8930k
    Peak memory use after GGC: 8565k -> 8558k
    Maximum of released memory in single GGC run: 2576k
    Garbage: 34995k -> 34882k
    Leak: 6058k
    Overhead: 4736k -> 4715k
    GGC runs: 296 -> 294

comparing combine.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 6071k to 6079k, overall 0.13%
    Overall memory needed: 36185k -> 36193k
    Peak memory use before GGC: 17003k
    Peak memory use after GGC: 16831k
    Maximum of released memory in single GGC run: 2264k
    Garbage: 54915k -> 54849k
    Leak: 6071k -> 6079k
    Overhead: 5778k -> 5766k
    GGC runs: 376 -> 375

comparing combine.c compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 6173k to 6181k, overall 0.13%
    Overall memory needed: 26500k
    Peak memory use before GGC: 17000k
    Peak memory use after GGC: 16831k
    Maximum of released memory in single GGC run: 2539k
    Garbage: 78583k -> 78524k
    Leak: 6173k -> 6181k
    Overhead: 8310k -> 8299k
    GGC runs: 441 -> 439

comparing combine.c compilation at -O3 level:
    Overall memory needed: 25596k
    Peak memory use before GGC: 18135k
    Peak memory use after GGC: 17449k
    Maximum of released memory in single GGC run: 3325k
    Garbage: 107566k -> 107492k
    Leak: 6250k
    Overhead: 11494k -> 11479k
    GGC runs: 488 -> 487

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 83700k
    Peak memory use before GGC: 68249k
    Peak memory use after GGC: 43997k -> 43914k
    Maximum of released memory in single GGC run: 35709k
    Garbage: 126249k -> 126210k
    Leak: 9118k -> 8878k
    Overhead: 16889k -> 16830k
    GGC runs: 230

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 103084k -> 103088k
    Peak memory use before GGC: 83524k
    Peak memory use after GGC: 77617k
    Maximum of released memory in single GGC run: 31805k
    Garbage: 259632k -> 259508k
    Leak: 8930k
    Overhead: 28472k -> 28448k
    GGC runs: 232

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 105360k -> 105356k
    Peak memory use before GGC: 87821k
    Peak memory use after GGC: 79916k
    Maximum of released memory in single GGC run: 30384k
    Garbage: 306132k -> 306011k
    Leak: 8935k
    Overhead: 35504k -> 35480k
    GGC runs: 257

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 105396k -> 105392k
    Peak memory use before GGC: 87847k
    Peak memory use after GGC: 79943k
    Maximum of released memory in single GGC run: 30571k
    Garbage: 306724k -> 306601k
    Leak: 8938k
    Overhead: 35682k -> 35657k
    GGC runs: 261

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 116272k
    Peak memory use before GGC: 92435k -> 92434k
    Peak memory use after GGC: 91514k
    Maximum of released memory in single GGC run: 19648k -> 19647k
    Garbage: 199817k -> 199212k
    Leak: 47214k
    Overhead: 20461k -> 20339k
    GGC runs: 398

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 115252k
    Peak memory use before GGC: 97008k
    Peak memory use after GGC: 94817k
    Maximum of released memory in single GGC run: 18293k
    Garbage: 435939k -> 435546k
    Leak: 49027k
    Overhead: 31296k -> 31225k
    GGC runs: 551 -> 550

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 115280k
    Peak memory use before GGC: 97009k
    Peak memory use after GGC: 94817k
    Maximum of released memory in single GGC run: 18293k
    Garbage: 522679k -> 522352k
    Leak: 49742k
    Overhead: 39390k -> 39325k
    GGC runs: 627

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 116640k
    Peak memory use before GGC: 98446k
    Peak memory use after GGC: 96093k
    Maximum of released memory in single GGC run: 18613k
    Garbage: 541253k -> 540926k
    Leak: 49722k -> 49722k
    Overhead: 40269k -> 40205k
    GGC runs: 639 -> 637

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 134136k
    Peak memory use before GGC: 81628k -> 81627k
    Peak memory use after GGC: 58507k
    Maximum of released memory in single GGC run: 45492k
    Garbage: 143523k -> 143522k
    Leak: 7142k
    Overhead: 25103k -> 25103k
    GGC runs: 87

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 432372k -> 432556k
    Peak memory use before GGC: 203917k
    Peak memory use after GGC: 199695k
    Maximum of released memory in single GGC run: 100795k
    Garbage: 272002k -> 272002k
    Leak: 47195k
    Overhead: 30026k -> 30026k
    GGC runs: 106

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 354884k
    Peak memory use before GGC: 213376k
    Peak memory use after GGC: 200446k
    Maximum of released memory in single GGC run: 107072k
    Garbage: 387716k -> 387716k
    Leak: 47779k
    Overhead: 47627k -> 47627k
    GGC runs: 113

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 536336k -> 536244k
    Peak memory use before GGC: 314603k
    Peak memory use after GGC: 292947k
    Maximum of released memory in single GGC run: 163427k
    Garbage: 487439k -> 487439k
    Leak: 65111k
    Overhead: 58883k -> 58883k
    GGC runs: 100

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-09-06 17:38:09.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-09-07 05:04:05.000000000 +0000
@@ -1,3 +1,20 @@
+2006-09-06  James E Wilson  <wilson@specifix.com>
+
+	PR rtl-opt/27883
+	* flow.c (update_life_info): If UPDATE_LIFE_LOCAL and PROP_DEATH_NOTES
+	then call count_or_remove_death_notes.
+
+2006-09-06  Jason Merrill  <jason@redhat.com>
+
+	PR c++/27371
+	* tree-inline.c (copy_result_decl_to_var): New fn.
+	(declare_return_variable): Use it.  Call declare_inline_vars here.
+	(expand_call_inline): Not here.
+
+2006-09-06  Diego Novillo  <dnovillo@redhat.com>
+
+	* doc/contrib.texi: Update my entry.
+
 2006-09-06  Nick Clifton  <nickc@redhat.com>
 
 	* config/frv/frv.h (EXTRA_MEMORY_CONSTRAINT): Define.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2006-09-06 17:38:09.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2006-09-07 05:04:05.000000000 +0000
@@ -1,5 +1,20 @@
+2006-09-06  Mark Mitchell  <mark@codesourcery.com>
+
+	PR c++/28903
+	* pt.c (tsubst): Use fold_non_dependent_expr to fold array
+	dimensions.
+
+	PR c++/28886
+	* pt.c (unify): Avoid unnecessary calls to fold_build2 for array
+	dimensions.
+
 2006-09-06  Jason Merrill  <jason@redhat.com>
 
+	PR c++/27371
+	* cvt.c (convert_to_void): Strip useless TARGET_EXPR.
+	* cp-tree.h (TARGET_EXPR_IMPLICIT_P): New macro.
+	* tree.c (build_cplus_new): Set it.
+
 	PR c++/26696
 	* cvt.c (convert_to_void): Replace a subexpression with no side 
 	effects with void_zero_node.


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]