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: 24721k
    Peak memory use before GGC: 9160k
    Peak memory use after GGC: 8547k
    Maximum of released memory in single GGC run: 2580k
    Garbage: 38214k
    Leak: 6052k
    Overhead: 5326k
    GGC runs: 307

comparing combine.c compilation at -O1 level:
    Overall memory needed: 36121k -> 36145k
    Peak memory use before GGC: 16999k
    Peak memory use after GGC: 16828k
    Maximum of released memory in single GGC run: 2261k -> 2265k
    Garbage: 56528k -> 56543k
    Leak: 6066k -> 6066k
    Overhead: 6069k -> 6072k
    GGC runs: 378

comparing combine.c compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 6170k to 6178k, overall 0.13%
    Overall memory needed: 26496k
    Peak memory use before GGC: 16997k
    Peak memory use after GGC: 16828k
    Maximum of released memory in single GGC run: 2254k -> 2253k
    Garbage: 80296k -> 80222k
    Leak: 6170k -> 6178k
    Overhead: 8599k -> 8595k
    GGC runs: 446 -> 447

comparing combine.c compilation at -O3 level:
    Overall memory needed: 25600k
    Peak memory use before GGC: 18087k -> 18088k
    Peak memory use after GGC: 17424k
    Maximum of released memory in single GGC run: 3329k -> 3321k
    Garbage: 109814k -> 109671k
    Leak: 6247k -> 6243k
    Overhead: 11868k -> 11868k
    GGC runs: 493 -> 492

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

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 103676k -> 102556k
    Peak memory use before GGC: 83566k -> 83523k
    Peak memory use after GGC: 77686k -> 77616k
    Maximum of released memory in single GGC run: 31934k -> 31804k
    Garbage: 268544k -> 268209k
    Leak: 8940k -> 8929k
    Overhead: 29968k -> 29929k
    GGC runs: 235

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 103652k -> 103604k
    Peak memory use before GGC: 87827k -> 87820k
    Peak memory use after GGC: 79920k -> 79916k
    Maximum of released memory in single GGC run: 30382k -> 30384k
    Garbage: 314655k -> 314657k
    Leak: 8935k -> 8935k
    Overhead: 36951k -> 36951k
    GGC runs: 263

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 103660k -> 103628k
    Peak memory use before GGC: 87853k -> 87847k
    Peak memory use after GGC: 79946k -> 79942k
    Maximum of released memory in single GGC run: 30573k -> 30575k
    Garbage: 315246k -> 315255k
    Leak: 8938k
    Overhead: 37130k -> 37131k
    GGC runs: 267

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

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 114908k
    Peak memory use before GGC: 97241k
    Peak memory use after GGC: 95100k
    Maximum of released memory in single GGC run: 18447k
    Garbage: 447374k -> 447408k
    Leak: 49093k -> 49095k
    Overhead: 32322k -> 32321k
    GGC runs: 561

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 114940k
    Peak memory use before GGC: 97243k
    Peak memory use after GGC: 95101k
    Maximum of released memory in single GGC run: 18448k
    Garbage: 531921k -> 532067k
    Leak: 49804k -> 49806k
    Overhead: 40220k -> 40195k
    GGC runs: 638 -> 640

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 117280k
    Peak memory use before GGC: 98676k
    Peak memory use after GGC: 96381k
    Maximum of released memory in single GGC run: 18759k
    Garbage: 552961k -> 553006k
    Leak: 50120k -> 50124k
    Overhead: 41360k -> 41388k
    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
    Leak: 7142k
    Overhead: 29023k
    GGC runs: 87

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

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

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Amount of produced GGC garbage increased from 494442k to 494953k, overall 0.10%
    Overall memory needed: 777924k -> 781456k
    Peak memory use before GGC: 314602k
    Peak memory use after GGC: 292946k
    Maximum of released memory in single GGC run: 163430k
    Garbage: 494442k -> 494953k
    Leak: 65110k
    Overhead: 60248k -> 60330k
    GGC runs: 100

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-08-03 18:58:22.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-08-04 07:40:39.000000000 +0000
@@ -1,3 +1,34 @@
+2006-08-04  Kazu Hirata  <kazu@codesourcery.com>
+
+	* tree-cfg.c: Fix a comment typo.
+
+2006-08-03  Mark Mitchell  <mark@codesourcery.com>
+
+	PR c++/28148
+	* varasm.c (output_constant): Give the front end another chance to
+	expand constants, after stripping NOPs.
+
+2006-08-03  Jan Hubicka  <jh@suse.cz>
+
+	* domwalk.c (walk_dominator_tree): Reorganize to non-recursive
+	implementation.
+
+2006-08-03  Dorit Nuzman  <dorit@il.ibm.com>
+
+        PR tree-optimization/27770
+        * tree-vectorizer.h (get_vectype_for_scalar_type): Function
+        declaration removed (moved to tree-flow.h).
+        (vect_can_force_dr_alignment_p): Likewise.
+        * tree-flow.h (get_vectype_for_scalar_type): New function declaration
+        (moved from tree-vectorizer.h).
+        (vect_can_force_dr_alignment_p): Likewise.
+        * tree-vectorizer.c (vect_print_dump_info): Allow calling this function
+        from outside the vectorizer - in particular from cgraph stage.
+        * tree-vect-analyze.c (vect_compute_data_ref_alignment): Don't increase
+        the alignment of global arrays when -fsection-anchors is enabled.
+        * cgraphunit.c (cgraph_increase_alignment): New function.
+        (cgraph_optimize): Call cgraph_increase_alignment.
+
 2006-08-03  David Edelsohn  <edelsohn@gnu.org>
 
 	PR target/27566


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]