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 combine.c compilation at -O0 level:
    Overall memory needed: 24725k -> 24721k
    Peak memory use before GGC: 9591k
    Peak memory use after GGC: 8938k
    Maximum of released memory in single GGC run: 2754k
    Garbage: 41378k
    Leak: 6709k
    Overhead: 5842k
    GGC runs: 320

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage decreased from 70041k to 66036k, overall -6.06%
    Overall memory needed: 23916k -> 23924k
    Peak memory use before GGC: 17376k -> 17374k
    Peak memory use after GGC: 17181k
    Maximum of released memory in single GGC run: 2436k -> 2418k
    Garbage: 70041k -> 66036k
    Leak: 7171k -> 7173k
    Overhead: 8660k -> 7501k
    GGC runs: 426 -> 412

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage decreased from 88288k to 84405k, overall -4.60%
  Amount of memory still referenced at the end of compilation increased from 7397k to 7411k, overall 0.18%
    Overall memory needed: 23928k -> 23940k
    Peak memory use before GGC: 17383k -> 17380k
    Peak memory use after GGC: 17181k
    Maximum of released memory in single GGC run: 2519k -> 2500k
    Garbage: 88288k -> 84405k
    Leak: 7397k -> 7411k
    Overhead: 11231k -> 10034k
    GGC runs: 501 -> 482

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage decreased from 119222k to 115606k, overall -3.13%
  Amount of memory still referenced at the end of compilation increased from 7470k to 7484k, overall 0.19%
    Overall memory needed: 24436k -> 24440k
    Peak memory use before GGC: 17693k -> 17650k
    Peak memory use after GGC: 17257k -> 17262k
    Maximum of released memory in single GGC run: 3371k -> 3341k
    Garbage: 119222k -> 115606k
    Leak: 7470k -> 7484k
    Overhead: 15004k -> 13196k
    GGC runs: 545 -> 533

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 81648k
    Peak memory use before GGC: 70268k
    Peak memory use after GGC: 45007k
    Maximum of released memory in single GGC run: 37046k
    Garbage: 149716k
    Leak: 11585k
    Overhead: 19128k
    GGC runs: 252

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 116452k -> 115556k
    Peak memory use before GGC: 100093k -> 98428k
    Peak memory use after GGC: 89154k -> 87786k
    Maximum of released memory in single GGC run: 33049k -> 32759k
    Garbage: 300331k -> 295301k
    Leak: 11547k
    Overhead: 38189k -> 35277k
    GGC runs: 288 -> 283

comparing insn-attrtab.c compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 124852k to 129180k, overall 3.47%
  Peak amount of GGC memory still allocated after garbage collectin increased from 87156k to 87770k, overall 0.70%
    Overall memory needed: 124852k -> 129180k
    Peak memory use before GGC: 117531k
    Peak memory use after GGC: 87156k -> 87770k
    Maximum of released memory in single GGC run: 32732k -> 32441k
    Garbage: 385555k -> 381881k
    Leak: 11662k
    Overhead: 49187k -> 47146k
    GGC runs: 326 -> 319

comparing insn-attrtab.c compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 124852k to 129188k, overall 3.47%
  Peak amount of GGC memory still allocated after garbage collectin increased from 87158k to 87771k, overall 0.70%
    Overall memory needed: 124852k -> 129188k
    Peak memory use before GGC: 117532k
    Peak memory use after GGC: 87158k -> 87771k
    Maximum of released memory in single GGC run: 32732k -> 32441k
    Garbage: 386106k -> 382398k
    Leak: 11678k
    Overhead: 49344k -> 47295k
    GGC runs: 329 -> 323

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119108k
    Peak memory use before GGC: 95788k
    Peak memory use after GGC: 94840k
    Maximum of released memory in single GGC run: 20762k
    Garbage: 224400k
    Leak: 49424k
    Overhead: 36945k
    GGC runs: 339

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage decreased from 647423k to 595837k, overall -8.66%
  Amount of memory still referenced at the end of compilation increased from 55260k to 55375k, overall 0.21%
    Overall memory needed: 104600k -> 104960k
    Peak memory use before GGC: 94848k
    Peak memory use after GGC: 93906k
    Maximum of released memory in single GGC run: 19825k
    Garbage: 647423k -> 595837k
    Leak: 55260k -> 55375k
    Overhead: 78205k -> 64261k
    GGC runs: 543 -> 519

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage decreased from 725486k to 677845k, overall -7.03%
    Overall memory needed: 104912k -> 105152k
    Peak memory use before GGC: 94848k
    Peak memory use after GGC: 93906k
    Maximum of released memory in single GGC run: 19825k
    Garbage: 725486k -> 677845k
    Leak: 56293k -> 56310k
    Overhead: 88854k -> 75317k
    GGC runs: 614 -> 588

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage decreased from 772175k to 719773k, overall -7.28%
    Overall memory needed: 106780k -> 106712k
    Peak memory use before GGC: 95930k
    Peak memory use after GGC: 94979k
    Maximum of released memory in single GGC run: 19927k
    Garbage: 772175k -> 719773k
    Leak: 56821k -> 56806k
    Overhead: 93117k -> 78460k
    GGC runs: 634 -> 600

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-07-11 00:06:29.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-07-11 04:36:17.000000000 +0000
@@ -1,3 +1,38 @@
+2005-07-10  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	PR middle-end/22239
+	PR target/20126
+	* loop.c (loop_givs_rescan): Use expand_simple_binop instead of
+	gen_rtx_MINUS to handle non-replaceable (plus ((x) (const)).
+
+2005-07-07  Daniel Berlin  <dberlin@dberlin.org>
+
+	* tree-ssa-structalias.c (struct variable_info): Heapify complex.
+	(varmap): Heapify varmap.
+	(constraints): Heapify constraints.
+	(struct constraint_graph): Heapify succs and preds.
+	(constraint_vec_find): Update for heapification.
+	(constraint_set_union): Ditto.
+	(insert_into_complex): Ditto.
+	(constraint_edge_vec_find): Ditto.
+	(erase_graph_self_edge): Ditto.
+	(add_graph_edge): Ditto.
+	(get_graph_weights): Ditto.
+	(merge_graph_nodes): Ditto.
+	(build_constraint_graph): Ditto.
+	(topo_visit): Ditto.
+	(solve_graph): Ditto.
+	(create_variable_info_for): Ditto.
+	(init_base_vars): Ditto.
+	(delete_points_to_sets): Free graph, varmap, and complex constraints.
+	(condese_varmap_nodes): Free complex vector.
+	(clear_edges_for_node): Clear succs and preds vector.
+
+2005-07-10  Daniel Berlin  <dberlin@dberlin.org>
+
+	* tree-ssa-structalias.c (update_alias_info): Change counting of
+	references to not include vdefs.
+	
 2005-07-10  Daniel Berlin  <dberlin@dberlin.org>
 
 	* tree-ssa-alias.c (free_used_part_map): Add missing free.


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]