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: 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: 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: 8359k -> 8367k
    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: 8383k -> 8399k
    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: 8383k -> 8399k
    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: 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: 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:
  Amount of produced GGC garbage increased from 52731k to 53197k, overall 0.88%
    Overall memory needed: 37375k -> 37479k
    Peak memory use before GGC: 18939k -> 18941k
    Peak memory use after GGC: 18749k
    Maximum of released memory in single GGC run: 1372k
    Garbage: 52731k -> 53197k
    Leak: 8729k
    Overhead: 6370k -> 6462k
    GGC runs: 325 -> 326

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

comparing combine.c compilation at -O3 level:
  Ovarall memory allocated via mmap and sbrk decreased from 44563k to 41803k, overall -6.60%
    Overall memory needed: 44563k -> 41803k
    Peak memory use before GGC: 19324k -> 19249k
    Peak memory use after GGC: 18929k -> 18934k
    Maximum of released memory in single GGC run: 2345k -> 2208k
    Garbage: 95206k -> 94269k
    Leak: 8970k -> 8966k
    Overhead: 11592k -> 11502k
    GGC runs: 417

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 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: 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:
  Peak amount of GGC memory allocated before garbage collecting increased from 58819k to 59276k, overall 0.78%
  Peak amount of GGC memory still allocated after garbage collecting increased from 54590k to 55051k, overall 0.84%
  Amount of produced GGC garbage increased from 216879k to 218355k, overall 0.68%
    Overall memory needed: 153523k -> 153747k
    Peak memory use before GGC: 58819k -> 59276k
    Peak memory use after GGC: 54590k -> 55051k
    Maximum of released memory in single GGC run: 23586k -> 23587k
    Garbage: 216879k -> 218355k
    Leak: 11321k
    Overhead: 24851k -> 25147k
    GGC runs: 228

comparing insn-attrtab.c compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 58704k to 59158k, overall 0.77%
  Peak amount of GGC memory still allocated after garbage collecting increased from 54648k to 55111k, overall 0.85%
  Amount of produced GGC garbage increased from 252848k to 254255k, overall 0.56%
    Overall memory needed: 192199k -> 192299k
    Peak memory use before GGC: 58704k -> 59158k
    Peak memory use after GGC: 54648k -> 55111k
    Maximum of released memory in single GGC run: 21339k
    Garbage: 252848k -> 254255k
    Leak: 11315k -> 11315k
    Overhead: 30514k -> 30795k
    GGC runs: 252 -> 253

comparing insn-attrtab.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 71096k to 71558k, overall 0.65%
  Peak amount of GGC memory still allocated after garbage collecting increased from 65483k to 65945k, overall 0.71%
  Amount of produced GGC garbage increased from 281897k to 283292k, overall 0.49%
    Overall memory needed: 197743k -> 198179k
    Peak memory use before GGC: 71096k -> 71558k
    Peak memory use after GGC: 65483k -> 65945k
    Maximum of released memory in single GGC run: 22953k -> 22949k
    Garbage: 281897k -> 283292k
    Leak: 11324k -> 11323k
    Overhead: 32217k -> 32508k
    GGC runs: 255 -> 256

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 156091k -> 156119k
    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: 177203k -> 177207k
    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:
  Amount of produced GGC garbage increased from 330033k to 331882k, overall 0.56%
    Overall memory needed: 152323k -> 153359k
    Peak memory use before GGC: 103213k -> 103220k
    Peak memory use after GGC: 102155k
    Maximum of released memory in single GGC run: 17399k
    Garbage: 330033k -> 331882k
    Leak: 53851k
    Overhead: 30466k -> 30835k
    GGC runs: 499 -> 500

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 388153k to 390044k, overall 0.49%
    Overall memory needed: 163879k -> 163747k
    Peak memory use before GGC: 103750k -> 103759k
    Peak memory use after GGC: 102719k -> 102721k
    Maximum of released memory in single GGC run: 17399k
    Garbage: 388153k -> 390044k
    Leak: 54891k -> 54912k
    Overhead: 37212k -> 37608k
    GGC runs: 557 -> 559

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 432152k to 434003k, overall 0.43%
    Overall memory needed: 169251k -> 168659k
    Peak memory use before GGC: 106103k -> 106116k
    Peak memory use after GGC: 105022k
    Maximum of released memory in single GGC run: 17712k
    Garbage: 432152k -> 434003k
    Leak: 55228k -> 55248k
    Overhead: 40853k -> 41256k
    GGC runs: 582 -> 585

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:
  Peak amount of GGC memory allocated before garbage collecting increased from 83356k to 84295k, overall 1.13%
  Amount of produced GGC garbage increased from 231076k to 232802k, overall 0.75%
    Overall memory needed: 311739k -> 308175k
    Peak memory use before GGC: 83356k -> 84295k
    Peak memory use after GGC: 75947k
    Maximum of released memory in single GGC run: 38345k -> 39284k
    Garbage: 231076k -> 232802k
    Leak: 22376k
    Overhead: 31549k -> 31894k
    GGC runs: 71 -> 70

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
  Amount of produced GGC garbage increased from 242063k to 243851k, overall 0.74%
    Overall memory needed: 316095k -> 315083k
    Peak memory use before GGC: 80933k
    Peak memory use after GGC: 75947k
    Maximum of released memory in single GGC run: 32891k -> 33653k
    Garbage: 242063k -> 243851k
    Leak: 22457k -> 22457k
    Overhead: 34089k -> 34447k
    GGC runs: 84

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 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-07 14:33:31.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-07-08 07:17:14.000000000 +0000
@@ -1,3 +1,36 @@
+2007-07-07  Daniel Berlin  <dberlin@dberlin.org>
+
+	Revert (note the sccvn portions are *not* reverted)
+	2007-07-06  Daniel Berlin  <dberlin@dberlin.org>
+
+	Fix PR tree-optimization/23488
+
+	* 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-07 Eric Weddington  <eweddington@cso.atmel.com>
+
+	* config/avr/constraints.md (define_memory_constraint "Q"): Fix
+	the constraint description.
+	* doc/md.texi: Update documentation of AVR constraints.
+
 2007-07-07  Kazu Hirata  <kazu@codesourcery.com>
 
 	* auto-inc-dec.c, config/arm/arm.c,


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]