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: 8333k -> 8331k
    Peak memory use before GGC: 3357k
    Peak memory use after GGC: 3021k
    Maximum of released memory in single GGC run: 336k
    Garbage: 491k
    Leak: 3754k
    Overhead: 875k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8349k -> 8347k
    Peak memory use before GGC: 3385k
    Peak memory use after GGC: 3048k
    Maximum of released memory in single GGC run: 337k
    Garbage: 493k
    Leak: 3787k
    Overhead: 879k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 8369k -> 8359k
    Peak memory use before GGC: 3357k
    Peak memory use after GGC: 3021k
    Maximum of released memory in single GGC run: 336k
    Garbage: 496k
    Leak: 3757k
    Overhead: 875k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 8397k -> 8383k
    Peak memory use before GGC: 3358k
    Peak memory use after GGC: 3021k
    Maximum of released memory in single GGC run: 337k
    Garbage: 500k
    Leak: 3757k
    Overhead: 876k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 8397k -> 8383k
    Peak memory use before GGC: 3358k
    Peak memory use after GGC: 3021k
    Maximum of released memory in single GGC run: 337k
    Garbage: 500k
    Leak: 3757k
    Overhead: 876k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23737k -> 23739k
    Peak memory use before GGC: 10293k
    Peak memory use after GGC: 9510k
    Maximum of released memory in single GGC run: 1908k
    Garbage: 38898k
    Leak: 8672k
    Overhead: 5362k
    GGC runs: 251

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 25621k -> 25623k
    Peak memory use before GGC: 11956k
    Peak memory use after GGC: 11301k
    Maximum of released memory in single GGC run: 1516k
    Garbage: 39207k
    Leak: 11565k
    Overhead: 6068k
    GGC runs: 251

comparing combine.c compilation at -O1 level:
    Overall memory needed: 37481k -> 37375k
    Peak memory use before GGC: 18941k -> 18939k
    Peak memory use after GGC: 18749k
    Maximum of released memory in single GGC run: 1374k -> 1372k
    Garbage: 53191k -> 52731k
    Leak: 8730k -> 8729k
    Overhead: 6461k -> 6370k
    GGC runs: 326 -> 325

comparing combine.c compilation at -O2 level:
    Overall memory needed: 39485k -> 39775k
    Peak memory use before GGC: 18994k
    Peak memory use after GGC: 18805k -> 18804k
    Maximum of released memory in single GGC run: 1399k -> 1400k
    Garbage: 72347k -> 72347k
    Leak: 8847k -> 8844k
    Overhead: 8785k -> 8729k
    GGC runs: 390 -> 389

comparing combine.c compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 41817k to 44563k, overall 6.57%
  Peak amount of GGC memory allocated before garbage collecting increased from 19249k to 19324k, overall 0.39%
  Amount of produced GGC garbage increased from 94260k to 95206k, overall 1.00%
  Amount of memory still referenced at the end of compilation increased from 8960k to 8970k, overall 0.11%
    Overall memory needed: 41817k -> 44563k
    Peak memory use before GGC: 19249k -> 19324k
    Peak memory use after GGC: 18934k -> 18929k
    Maximum of released memory in single GGC run: 2208k -> 2345k
    Garbage: 94260k -> 95206k
    Leak: 8960k -> 8970k
    Overhead: 11499k -> 11592k
    GGC runs: 417

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 143321k -> 143323k
    Peak memory use before GGC: 61019k
    Peak memory use after GGC: 34025k
    Maximum of released memory in single GGC run: 34625k
    Garbage: 132717k
    Leak: 11189k
    Overhead: 14754k
    GGC runs: 196

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 144569k -> 144575k
    Peak memory use before GGC: 62181k
    Peak memory use after GGC: 35185k
    Maximum of released memory in single GGC run: 34626k
    Garbage: 132946k
    Leak: 12898k
    Overhead: 15151k
    GGC runs: 200

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 153745k -> 153523k
    Peak memory use before GGC: 59276k -> 58819k
    Peak memory use after GGC: 55051k -> 54590k
    Maximum of released memory in single GGC run: 23587k -> 23586k
    Garbage: 218381k -> 216879k
    Leak: 11321k -> 11321k
    Overhead: 25147k -> 24851k
    GGC runs: 228

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 192301k -> 192199k
    Peak memory use before GGC: 59158k -> 58704k
    Peak memory use after GGC: 55111k -> 54648k
    Maximum of released memory in single GGC run: 21339k
    Garbage: 254255k -> 252848k
    Leak: 11315k -> 11315k
    Overhead: 30795k -> 30514k
    GGC runs: 253 -> 252

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 198181k -> 197743k
    Peak memory use before GGC: 71558k -> 71096k
    Peak memory use after GGC: 65945k -> 65483k
    Maximum of released memory in single GGC run: 22950k -> 22953k
    Garbage: 283292k -> 281897k
    Leak: 11325k -> 11324k
    Overhead: 32508k -> 32217k
    GGC runs: 256 -> 255

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 156097k -> 156091k
    Peak memory use before GGC: 91054k
    Peak memory use after GGC: 90152k
    Maximum of released memory in single GGC run: 17988k
    Garbage: 209581k
    Leak: 53737k
    Overhead: 24601k
    GGC runs: 396

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 177201k -> 177203k
    Peak memory use before GGC: 103968k
    Peak memory use after GGC: 102938k
    Maximum of released memory in single GGC run: 18650k
    Garbage: 215425k
    Leak: 77165k
    Overhead: 30569k
    GGC runs: 373

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 153151k -> 152323k
    Peak memory use before GGC: 103219k -> 103213k
    Peak memory use after GGC: 102155k
    Maximum of released memory in single GGC run: 17399k
    Garbage: 331698k -> 330033k
    Leak: 53859k -> 53851k
    Overhead: 30813k -> 30466k
    GGC runs: 500 -> 499

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 163203k -> 163879k
    Peak memory use before GGC: 103758k -> 103750k
    Peak memory use after GGC: 102721k -> 102719k
    Maximum of released memory in single GGC run: 17399k
    Garbage: 389590k -> 388153k
    Leak: 54911k -> 54891k
    Overhead: 37517k -> 37212k
    GGC runs: 560 -> 557

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 168059k -> 169251k
    Peak memory use before GGC: 106114k -> 106103k
    Peak memory use after GGC: 105022k
    Maximum of released memory in single GGC run: 17712k
    Garbage: 433639k -> 432152k
    Leak: 55241k -> 55228k
    Overhead: 41133k -> 40853k
    GGC runs: 584 -> 582

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 387671k
    Peak memory use before GGC: 103448k
    Peak memory use after GGC: 59101k
    Maximum of released memory in single GGC run: 50583k
    Garbage: 179419k
    Leak: 8939k
    Overhead: 31381k
    GGC runs: 64

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 388463k
    Peak memory use before GGC: 104094k
    Peak memory use after GGC: 59748k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179523k
    Leak: 10707k
    Overhead: 31877k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 308081k -> 311739k
    Peak memory use before GGC: 84295k -> 83356k
    Peak memory use after GGC: 75947k
    Maximum of released memory in single GGC run: 39284k -> 38345k
    Garbage: 232360k -> 231076k
    Leak: 22376k
    Overhead: 31831k -> 31549k
    GGC runs: 70 -> 71

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 316053k -> 316095k
    Peak memory use before GGC: 80933k
    Peak memory use after GGC: 75947k
    Maximum of released memory in single GGC run: 33653k -> 32891k
    Garbage: 243170k -> 242063k
    Leak: 22457k -> 22457k
    Overhead: 34350k -> 34089k
    GGC runs: 84

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1965705k -> 1966555k
    Peak memory use before GGC: 190538k
    Peak memory use after GGC: 178054k
    Maximum of released memory in single GGC run: 81025k
    Garbage: 389440k
    Leak: 47091k
    Overhead: 48668k
    GGC runs: 65

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-07-06 21:46:50.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-07-07 14:33:31.000000000 +0000
@@ -1,3 +1,54 @@
+2007-07-07  Kazu Hirata  <kazu@codesourcery.com>
+
+	* auto-inc-dec.c, config/arm/arm.c,
+	config/m32r/constraints.md, config/mips/mips.md,
+	config/rs6000/rs6000.c, cselib.c, dce.c, df-core.c,
+	df-problems.c, df-scan.c, df.h, dse.c, gimplify.c,
+	tree-if-conv.c, tree-ssa-sccvn.c, tree-ssa.c: Fix comment
+	typos.  Follow spelling conventions.
+	* doc/invoke.texi, doc/rtl.texi: Fix typos.
+
+	* cfgrtl.c (delete_insn_chain_and_edges): Remove.
+	* rtl.h: Remove the prototype for delete_insn_chain_and_edges.
+
+	* tree-ssa-operands.c (realloc_vop, realloc_vdef,
+	realloc_vuse): Remove.
+	* tree-ssa-operands.h: Remove the prototype for realloc_vdef
+	and realloc_vuse.
+
+2007-07-06  Daniel Berlin  <dberlin@dberlin.org>
+
+	Fix PR tree-optimization/23488
+
+	* tree-ssa-sccvn.c (expr_has_constants): Handle tcc_declaration.
+	(try_to_simplify): Ditto.
+	(visit_use): Ditto.
+	* tree-vn.c (set_value_handle): Use decl_vh_map for decl value
+	handles.
+	* tree-flow-inline.h (get_value_handle): Ditto.
+	* tree-ssa-pre.c (decl_vh_map): New.
+	(decl_node_pool): New.
+	(can_value_number_operation): Support DECL_P.
+	(can_PRE_operation): Ditto.
+	(create_expression_by_pieces): Ditto.
+	(find_existing_value_expr): Modify to differnetiate between
+	addressing and top level.
+	(create_value_handle_for_expr): Handle DECL's.
+	(poolify_tree): Ditto.
+	(make_values_for_phi): Don't insert into PHI_GEN during FRE.
+	(make_values_for_stmt): Handle DECL's properly.
+	(init_pre): Reorg to not init useless things during FRE.
+	(fini_pre): Ditto.
+	* tree-flow.h: Include pointer-set.h.
+	(decl_vh_map): Declare.
+	* Makefile.in (TREE_FLOW_H): Add pointer-set.h
+		
+2007-07-06  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* c-opts.c (c_common_handle_option): Make DOLLARS_IN_IDENTIFIERS
+	apply to assembly language, too.
+	* doc/tm.texi (DOLLARS_IN_IDENTIFIERS): Update.
+
 2007-07-06  Ian Lance Taylor  <iant@google.com>
             Zack Weinberg  <zackw@panix.com>
 
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-07-06 21:46:49.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-07-07 14:33:27.000000000 +0000
@@ -1,3 +1,10 @@
+2007-07-07  Mark Mitchell  <mark@codesourcery.com>
+
+	PR c++/32232
+	* pt.c (resolve_overloaded_unification): Robustify.  Return a
+	bool, not an int.
+	(type_unification_real): Adjust accordingly.
+
 2007-07-06  Richard Guenther  <rguenther@suse.de>
 
 	* init.c (build_new_1): Use the correct pointer type.


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]