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: 18265k -> 18269k
    Peak memory use before GGC: 2233k
    Peak memory use after GGC: 1940k
    Maximum of released memory in single GGC run: 293k
    Garbage: 422k -> 422k
    Leak: 2271k
    Overhead: 446k -> 446k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 18281k -> 18285k
    Peak memory use before GGC: 2260k
    Peak memory use after GGC: 1967k
    Maximum of released memory in single GGC run: 293k
    Garbage: 425k -> 425k
    Leak: 2303k
    Overhead: 450k -> 450k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18369k
    Peak memory use before GGC: 2233k
    Peak memory use after GGC: 1940k
    Maximum of released memory in single GGC run: 293k
    Garbage: 427k -> 427k
    Leak: 2274k
    Overhead: 446k -> 446k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18381k
    Peak memory use before GGC: 2233k
    Peak memory use after GGC: 1940k
    Maximum of released memory in single GGC run: 293k
    Garbage: 431k -> 431k
    Leak: 2274k
    Overhead: 447k -> 447k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18381k
    Peak memory use before GGC: 2233k
    Peak memory use after GGC: 1940k
    Maximum of released memory in single GGC run: 293k
    Garbage: 431k -> 431k
    Leak: 2274k
    Overhead: 447k -> 447k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28469k -> 28473k
    Peak memory use before GGC: 9315k -> 9316k
    Peak memory use after GGC: 8854k
    Maximum of released memory in single GGC run: 2666k -> 2667k
    Garbage: 36864k -> 36872k
    Leak: 6466k
    Overhead: 4873k -> 4874k
    GGC runs: 280

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 30565k -> 30569k
    Peak memory use before GGC: 10884k -> 10885k
    Peak memory use after GGC: 10514k
    Maximum of released memory in single GGC run: 2415k
    Garbage: 37428k -> 37434k
    Leak: 9358k
    Overhead: 5574k -> 5576k
    GGC runs: 272

comparing combine.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 6514k to 6521k, overall 0.12%
    Overall memory needed: 40301k
    Peak memory use before GGC: 17308k
    Peak memory use after GGC: 17133k
    Maximum of released memory in single GGC run: 2329k
    Garbage: 57501k -> 57481k
    Leak: 6514k -> 6521k
    Overhead: 6232k -> 6216k
    GGC runs: 355

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29810k
    Peak memory use before GGC: 17302k
    Peak memory use after GGC: 17131k
    Maximum of released memory in single GGC run: 2870k
    Garbage: 74943k -> 74955k
    Leak: 6619k -> 6619k
    Overhead: 8486k -> 8487k
    GGC runs: 412 -> 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28890k
    Peak memory use before GGC: 18429k
    Peak memory use after GGC: 17857k
    Maximum of released memory in single GGC run: 4101k
    Garbage: 112639k -> 112654k
    Leak: 6681k -> 6681k
    Overhead: 13025k -> 13027k
    GGC runs: 462

    Overall memory needed: 28469k -> 28473k
    Peak memory use before GGC: 9315k -> 9316k
    Peak memory use after GGC: 8854k
    Maximum of released memory in single GGC run: 2666k -> 2667k
    Garbage: 36864k -> 36872k
    Leak: 6466k
    Overhead: 4873k -> 4874k
    GGC runs: 280

comparing combine.c compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 6514k to 6521k, overall 0.12%
    Overall memory needed: 40301k
    Peak memory use before GGC: 17308k
    Peak memory use after GGC: 17133k
    Maximum of released memory in single GGC run: 2329k
    Garbage: 57501k -> 57481k
    Leak: 6514k -> 6521k
    Overhead: 6232k -> 6216k
    GGC runs: 355

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29810k
    Peak memory use before GGC: 17302k
    Peak memory use after GGC: 17131k
    Maximum of released memory in single GGC run: 2870k
    Garbage: 74943k -> 74955k
    Leak: 6619k -> 6619k
    Overhead: 8486k -> 8487k
    GGC runs: 412 -> 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28890k
    Peak memory use before GGC: 18429k
    Peak memory use after GGC: 17857k
    Maximum of released memory in single GGC run: 4101k
    Garbage: 112639k -> 112654k
    Leak: 6681k -> 6681k
    Overhead: 13025k -> 13027k
    GGC runs: 462

comparing insn-attrtab.c compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 9283k to 9523k, overall 2.59%
    Overall memory needed: 88246k
    Peak memory use before GGC: 69796k
    Peak memory use after GGC: 44206k
    Maximum of released memory in single GGC run: 36964k
    Garbage: 129330k -> 129076k
    Leak: 9283k -> 9523k
    Overhead: 17004k -> 17005k
    GGC runs: 216

comparing insn-attrtab.c compilation at -O0 -g level:
  Amount of memory still referenced at the end of compilation increased from 10990k to 11006k, overall 0.15%
    Overall memory needed: 89426k
    Peak memory use before GGC: 70957k
    Peak memory use after GGC: 45473k
    Maximum of released memory in single GGC run: 36965k
    Garbage: 130486k -> 130490k
    Leak: 10990k -> 11006k
    Overhead: 17399k -> 17400k
    GGC runs: 212

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 114194k -> 112898k
    Peak memory use before GGC: 90381k
    Peak memory use after GGC: 83743k
    Maximum of released memory in single GGC run: 31852k
    Garbage: 277793k -> 277795k
    Leak: 9361k
    Overhead: 29779k -> 29780k
    GGC runs: 221

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 129354k
    Peak memory use before GGC: 92610k
    Peak memory use after GGC: 84722k
    Maximum of released memory in single GGC run: 30397k
    Garbage: 317211k -> 317214k
    Leak: 9363k
    Overhead: 36357k -> 36358k
    GGC runs: 243

comparing insn-attrtab.c compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 124558k to 129374k, overall 3.87%
    Overall memory needed: 124558k -> 129374k
    Peak memory use before GGC: 92636k -> 92637k
    Peak memory use after GGC: 84749k
    Maximum of released memory in single GGC run: 30585k
    Garbage: 318064k -> 318068k
    Leak: 9366k
    Overhead: 36592k -> 36593k
    GGC runs: 247

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Amount of produced GGC garbage increased from 208315k to 208568k, overall 0.12%
    Overall memory needed: 119894k
    Peak memory use before GGC: 93337k -> 93338k
    Peak memory use after GGC: 92402k
    Maximum of released memory in single GGC run: 19428k -> 19429k
    Garbage: 208315k -> 208568k
    Leak: 47803k
    Overhead: 21149k -> 21211k
    GGC runs: 409

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
  Amount of produced GGC garbage increased from 214897k to 215165k, overall 0.12%
    Overall memory needed: 133514k
    Peak memory use before GGC: 106742k -> 106736k
    Peak memory use after GGC: 105679k
    Maximum of released memory in single GGC run: 20492k -> 20486k
    Garbage: 214897k -> 215165k
    Leak: 71322k
    Overhead: 27054k -> 27116k
    GGC runs: 380 -> 381

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119522k
    Peak memory use before GGC: 98312k -> 98313k
    Peak memory use after GGC: 96027k
    Maximum of released memory in single GGC run: 18671k
    Garbage: 447491k -> 447525k
    Leak: 49669k -> 49669k
    Overhead: 32850k -> 32857k
    GGC runs: 559 -> 560

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119402k
    Peak memory use before GGC: 98127k -> 98128k
    Peak memory use after GGC: 95842k
    Maximum of released memory in single GGC run: 18694k
    Garbage: 505480k -> 505453k
    Leak: 50337k -> 50337k
    Overhead: 39829k -> 39821k
    GGC runs: 619 -> 617

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 119462k
    Peak memory use before GGC: 98103k
    Peak memory use after GGC: 97129k
    Maximum of released memory in single GGC run: 19074k
    Garbage: 527629k -> 527693k
    Leak: 50311k -> 50312k
    Overhead: 40993k -> 41002k
    GGC runs: 628

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137966k -> 137970k
    Peak memory use before GGC: 81913k
    Peak memory use after GGC: 58793k
    Maximum of released memory in single GGC run: 45494k
    Garbage: 147248k -> 147250k
    Leak: 7541k
    Overhead: 25306k -> 25306k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 138138k
    Peak memory use before GGC: 82559k
    Peak memory use after GGC: 59439k
    Maximum of released memory in single GGC run: 45559k
    Garbage: 147419k -> 147420k
    Leak: 9309k
    Overhead: 25801k -> 25801k
    GGC runs: 88

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 427906k
    Peak memory use before GGC: 206841k
    Peak memory use after GGC: 202617k
    Maximum of released memory in single GGC run: 101927k
    Garbage: 291933k -> 291935k
    Leak: 30049k
    Overhead: 31505k -> 31505k
    GGC runs: 100

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 351798k -> 351478k
    Peak memory use before GGC: 206006k
    Peak memory use after GGC: 201782k -> 201783k
    Maximum of released memory in single GGC run: 108826k
    Garbage: 370541k -> 370543k
    Leak: 30372k
    Overhead: 47035k -> 47035k
    GGC runs: 110

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 780718k -> 780930k
    Peak memory use before GGC: 314929k
    Peak memory use after GGC: 293272k -> 293273k
    Maximum of released memory in single GGC run: 165210k
    Garbage: 514889k -> 514891k
    Leak: 45424k
    Overhead: 59893k -> 59893k
    GGC runs: 98

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-11-30 08:40:35.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-12-01 01:01:27.000000000 +0000
@@ -1,3 +1,85 @@
+2006-11-30  Richard Sandiford  <richard@codesourcery.com>
+
+	* simplify-rtx.c (simplify_rtx): Use simplify_subreg rather than
+	simplify_gen_subreg.
+
+2006-11-30  Andrew Macleod  <amacleod@redhat.com>
+
+	* tree-ssa-live.c (create_coalesce_list): Create a hash table.
+	(COALESCE_HASH_FN): New.  Define hash function.
+	(partition_pair_map_hash): New.  Hash value for a partition pair.
+	(partition_pair_map_eq): New.  Equality for hash pairs.
+	(create_coalesce_list): Create hash table.
+	(delete_coalesce_list): Free hash table.
+	(find_partition_pair): Find/create pairs in hash table.
+	(compare_pairs):  Sort pairs in ascending order now.
+	(num_coalesce_pairs): New.  Number of pairs in hash table.
+	(struct partition_pair_iterator): Iterator struct for pair table.
+	(first_partition_pair): Iterator function for first pair.
+	(end_partition_pair_p): Iterator function for end of iteration.
+	(next_partition_pair): Iterator function for next pair.
+	(FOR_EACH_PARTITION_PAIR): Macro for iterating over pairs.
+	(sort_coalesce_list): Sort pairs from hash table into an array.
+	(pop_best_coalesce): Take pairs from the array.
+	(dump_coalesce_list): Update to use hash table or sorted array.
+	* tree-ssa-live.h (struct partition_pair_d): Remove next field.
+	(struct coalesce_list_d): Add hash table related fields.
+
+2006-11-30  Jan Hubicka  <jh@suse.cz>
+
+	PR middle-end/30028
+	* builtins.c (fold_builtin_memory_op): Fix typo in the check for
+	memmove/bcopy->memcpy conversion.
+
+2006-11-30  Carlos O'Donell  <carlos@codesourcery.com>
+
+	* doc/tm.texi (MAX_OFILE_ALIGNMENT): Document default.
+	* config/elfos.h [!MAX_OFILE_ALIGNMENT] (MAX_OFILE_ALIGNMENT): 
+	Default is the largest alignment supported for 32-bit ELF and 
+	representable on a 32-bit host.
+
+2006-11-30  Janis Johnson  <janis187@us.ibm.com>
+
+	* config/dfp-bit.c (DFP_TO_INT): Use wider precision.
+
+2006-11-30  Jan Hubicka  <jh@suse.cz>
+
+	* tree-ssa-operands.h (struct ssa_operands): New.
+	* tree-flow-inline.h (gimple_ssa_operands): New function.
+	* tree-flow.h: (struct gimple_df): Add ssa_operands.
+	* Makefile.in: Remove gt-tree-ssa-operands.h
+	* tree-ssa-operands.c: Do not include gt-tree-ssa-operands.h
+	(free_defs, free_uses, free_vuses, free_maydefs, free_mustdefs,
+	operand_memory, operand_memory_index, ops_active): Remove statics.
+	(ALLOC_OPTYPE): Update.
+	(operand_build_sort_virtual): Update.
+	(ssa_operands_active): Update.
+	(init_ssa_operands): Update.
+	(fini_ssa_operands): Update.
+	(ssa_operand_alloc): Update.
+	(INITIALIZE_USE): Update.
+	(finalize_ssa_use_ops): Update.
+	(finalize_ssa_v_may_def_ops): Update.
+	(finalize_ssa_vuse_ops): Update.
+	(finalize_ssa_v_must_def_ops): Update.
+
+2006-11-30  Richard Guenther  <rguenther@suse.de>
+
+	* tree-vectorizer.h (vectorizable_function): Export.
+	* tree-vect-transform.c (vectorizable_function): Likewise.
+        * tree-vect-patterns.c (vect_recog_pow_pattern): Set
+        type_in to scalar type in recognition of squaring.
+	Make sure the target can vectorize sqrt in recognition
+	of sqrt, set type_in to vector type in this case.
+
+2006-11-30  Uros Bizjak  <ubizjak@gmail.com>
+
+	* config/i386/i386.md (R10_REG): New constant.
+	* config/i386/i386.c (pro_epilogue_adjust_stack): Use R11_REG.
+	(ix86_emit_restore_regs_using_mov): Ditto.
+	(ix86_expand_call): Ditto.
+	(x86_output_mi_thunk): Ditto. Also use R10_REG.
+
 2006-11-30  Steven Bosscher  <steven@gcc.gnu.org>
 
 	* cselib.c (cselib_init): Use special MEM rtx form for callmem.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2006-11-29 16:08:05.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2006-12-01 01:01:14.000000000 +0000
@@ -1,3 +1,16 @@
+2006-12-01  Dirk Mueller  <dmueller@suse.de>
+
+	PR c++/18313
+	* decl.c (grokdeclarator): Warn for type qualifiers on return
+	type for non-dependent types.
+	* pt.c (tsubst_function_type): Warn for type qualifiers on
+	return type for dependent types.
+
+2006-11-30  Geoffrey Keating  <geoffk@apple.com>
+
+	* rtti.c (get_tinfo_decl): Handle return value from
+	pushdecl_top_level_and_finish.
+
 2006-11-29  Lee Millward  <lee.millward@codesourcery.com> 
 
 	PR c++/29022


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]