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: 18337k -> 18341k
    Peak memory use before GGC: 2263k
    Peak memory use after GGC: 1954k
    Maximum of released memory in single GGC run: 309k
    Garbage: 444k
    Leak: 2287k
    Overhead: 455k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 18353k -> 18357k
    Peak memory use before GGC: 2291k
    Peak memory use after GGC: 1981k
    Maximum of released memory in single GGC run: 310k
    Garbage: 447k
    Leak: 2320k
    Overhead: 460k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18445k -> 18449k
    Peak memory use before GGC: 2263k
    Peak memory use after GGC: 1954k
    Maximum of released memory in single GGC run: 309k
    Garbage: 450k
    Leak: 2290k
    Overhead: 456k -> 456k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18457k -> 18461k
    Peak memory use before GGC: 2264k
    Peak memory use after GGC: 1954k
    Maximum of released memory in single GGC run: 310k
    Garbage: 453k
    Leak: 2290k
    Overhead: 456k -> 456k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18457k -> 18461k
    Peak memory use before GGC: 2264k
    Peak memory use after GGC: 1954k
    Maximum of released memory in single GGC run: 310k
    Garbage: 453k
    Leak: 2290k
    Overhead: 456k -> 456k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28617k
    Peak memory use before GGC: 9311k
    Peak memory use after GGC: 8864k
    Maximum of released memory in single GGC run: 2605k
    Garbage: 37287k
    Leak: 6538k
    Overhead: 4829k
    GGC runs: 277

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 30669k
    Peak memory use before GGC: 10894k
    Peak memory use after GGC: 10523k
    Maximum of released memory in single GGC run: 2365k
    Garbage: 37869k
    Leak: 9414k
    Overhead: 5530k
    GGC runs: 271

comparing combine.c compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 20881k to 20030k, overall -4.25%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 20647k to 19831k, overall -4.11%
  Amount of memory still referenced at the end of compilation increased from 6565k to 6574k, overall 0.13%
    Overall memory needed: 33538k -> 33370k
    Peak memory use before GGC: 20881k -> 20030k
    Peak memory use after GGC: 20647k -> 19831k
    Maximum of released memory in single GGC run: 2262k -> 2264k
    Garbage: 55422k -> 55204k
    Leak: 6565k -> 6574k
    Overhead: 9964k -> 9948k
    GGC runs: 353

comparing combine.c compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 20903k to 20040k, overall -4.31%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 20693k to 19840k, overall -4.30%
    Overall memory needed: 33538k -> 33374k
    Peak memory use before GGC: 20903k -> 20040k
    Peak memory use after GGC: 20693k -> 19840k
    Maximum of released memory in single GGC run: 2203k -> 2205k
    Garbage: 71306k -> 71233k
    Leak: 6695k -> 6693k
    Overhead: 11868k -> 11868k
    GGC runs: 408 -> 409

comparing combine.c compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 21888k to 20847k, overall -4.99%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 21283k to 20386k, overall -4.40%
    Overall memory needed: 32766k -> 32578k
    Peak memory use before GGC: 21888k -> 20847k
    Peak memory use after GGC: 21283k -> 20386k
    Maximum of released memory in single GGC run: 3138k -> 3125k
    Garbage: 104250k -> 103457k
    Leak: 6768k -> 6763k
    Overhead: 16570k -> 16339k
    GGC runs: 463 -> 470

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 89190k -> 89062k
    Peak memory use before GGC: 70731k
    Peak memory use after GGC: 44749k
    Maximum of released memory in single GGC run: 37356k
    Garbage: 131555k
    Leak: 9579k
    Overhead: 16626k
    GGC runs: 210

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 90366k
    Peak memory use before GGC: 71892k
    Peak memory use after GGC: 46017k
    Maximum of released memory in single GGC run: 37356k
    Garbage: 132720k
    Leak: 11268k
    Overhead: 17020k
    GGC runs: 209

comparing insn-attrtab.c compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 75640k to 72733k, overall -4.00%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 71771k to 68887k, overall -4.19%
    Overall memory needed: 100710k -> 98198k
    Peak memory use before GGC: 75640k -> 72733k
    Peak memory use after GGC: 71771k -> 68887k
    Maximum of released memory in single GGC run: 31283k -> 31302k
    Garbage: 229008k -> 228280k
    Leak: 9404k -> 9397k
    Overhead: 29491k -> 29388k
    GGC runs: 219 -> 222

comparing insn-attrtab.c compilation at -O2 level:
  Ovarall memory allocated via mmap and sbrk decreased from 116074k to 110334k, overall -5.20%
  Peak amount of GGC memory allocated before garbage collecting run decreased from 82472k to 79562k, overall -3.66%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 76636k to 73752k, overall -3.91%
    Overall memory needed: 116074k -> 110334k
    Peak memory use before GGC: 82472k -> 79562k
    Peak memory use after GGC: 76636k -> 73752k
    Maximum of released memory in single GGC run: 29573k -> 29594k
    Garbage: 280468k -> 279538k
    Leak: 9401k -> 9394k
    Overhead: 35349k -> 35690k
    GGC runs: 241 -> 245

comparing insn-attrtab.c compilation at -O3 level:
  Ovarall memory allocated via mmap and sbrk decreased from 116066k to 110366k, overall -5.16%
  Peak amount of GGC memory allocated before garbage collecting run decreased from 82512k to 79602k, overall -3.66%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 76676k to 73792k, overall -3.91%
    Overall memory needed: 116066k -> 110366k
    Peak memory use before GGC: 82512k -> 79602k
    Peak memory use after GGC: 76676k -> 73792k
    Maximum of released memory in single GGC run: 29748k -> 29764k
    Garbage: 281193k -> 280271k
    Leak: 9405k -> 9398k
    Overhead: 35563k -> 35904k
    GGC runs: 241 -> 245

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119830k
    Peak memory use before GGC: 93043k
    Peak memory use after GGC: 92119k
    Maximum of released memory in single GGC run: 18913k
    Garbage: 208221k
    Leak: 49014k
    Overhead: 21199k
    GGC runs: 407

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 132298k
    Peak memory use before GGC: 105317k
    Peak memory use after GGC: 104273k
    Maximum of released memory in single GGC run: 18749k
    Garbage: 214812k
    Leak: 72442k
    Overhead: 27105k
    GGC runs: 382

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Ovarall memory allocated via mmap and sbrk decreased from 139602k to 132834k, overall -5.10%
  Peak amount of GGC memory allocated before garbage collecting run decreased from 112863k to 102898k, overall -9.68%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 111746k to 101878k, overall -9.69%
  Amount of produced GGC garbage decreased from 437334k to 397831k, overall -9.93%
    Overall memory needed: 139602k -> 132834k
    Peak memory use before GGC: 112863k -> 102898k
    Peak memory use after GGC: 111746k -> 101878k
    Maximum of released memory in single GGC run: 17926k
    Garbage: 437334k -> 397831k
    Leak: 51043k -> 50037k
    Overhead: 99333k -> 53233k
    GGC runs: 586 -> 574

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Ovarall memory allocated via mmap and sbrk decreased from 139650k to 132866k, overall -5.11%
  Peak amount of GGC memory allocated before garbage collecting run decreased from 112892k to 103002k, overall -9.60%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 111774k to 101946k, overall -9.64%
  Amount of produced GGC garbage decreased from 491128k to 454649k, overall -8.02%
    Overall memory needed: 139650k -> 132866k
    Peak memory use before GGC: 112892k -> 103002k
    Peak memory use after GGC: 111774k -> 101946k
    Maximum of released memory in single GGC run: 17926k
    Garbage: 491128k -> 454649k
    Leak: 52007k -> 50814k
    Overhead: 58653k -> 46350k
    GGC runs: 632 -> 630

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Ovarall memory allocated via mmap and sbrk decreased from 141518k to 134762k, overall -5.01%
  Peak amount of GGC memory allocated before garbage collecting run decreased from 114672k to 104577k, overall -9.65%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 113482k to 103536k, overall -9.61%
  Amount of produced GGC garbage decreased from 511741k to 470575k, overall -8.75%
    Overall memory needed: 141518k -> 134762k
    Peak memory use before GGC: 114672k -> 104577k
    Peak memory use after GGC: 113482k -> 103536k
    Maximum of released memory in single GGC run: 18326k
    Garbage: 511741k -> 470575k
    Leak: 51978k -> 51029k
    Overhead: 58582k -> 45817k
    GGC runs: 643 -> 641

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137646k
    Peak memory use before GGC: 81607k
    Peak memory use after GGC: 58486k
    Maximum of released memory in single GGC run: 44560k
    Garbage: 148154k
    Leak: 8080k
    Overhead: 25066k
    GGC runs: 81

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 138198k
    Peak memory use before GGC: 82252k
    Peak memory use after GGC: 59132k
    Maximum of released memory in single GGC run: 44208k
    Garbage: 148372k
    Leak: 9335k
    Overhead: 25561k
    GGC runs: 89

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 417830k -> 417934k
    Peak memory use before GGC: 200847k -> 200592k
    Peak memory use after GGC: 193545k -> 193290k
    Maximum of released memory in single GGC run: 112452k -> 112412k
    Garbage: 282084k -> 281676k
    Leak: 29804k
    Overhead: 32000k -> 32067k
    GGC runs: 91 -> 92

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 342118k -> 340130k
    Peak memory use before GGC: 200841k -> 200587k
    Peak memory use after GGC: 193539k -> 193285k
    Maximum of released memory in single GGC run: 111877k -> 111836k
    Garbage: 359133k -> 358730k
    Leak: 30387k
    Overhead: 47154k -> 47222k
    GGC runs: 101 -> 99

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Ovarall memory allocated via mmap and sbrk decreased from 923246k to 712530k, overall -29.57%
  Peak amount of GGC memory allocated before garbage collecting run decreased from 317308k to 299947k, overall -5.79%
  Peak amount of GGC memory still allocated after garbage collecting decreased from 295751k to 278933k, overall -6.03%
  Amount of produced GGC garbage decreased from 494906k to 452840k, overall -9.29%
    Overall memory needed: 923246k -> 712530k
    Peak memory use before GGC: 317308k -> 299947k
    Peak memory use after GGC: 295751k -> 278933k
    Maximum of released memory in single GGC run: 168454k -> 158589k
    Garbage: 494906k -> 452840k
    Leak: 45439k
    Overhead: 59089k -> 56125k
    GGC runs: 97

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-01-11 16:11:20.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-01-12 08:03:04.000000000 +0000
@@ -1,3 +1,72 @@
+2007-01-11  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* pa-linux.h (ASM_OUTPUT_INTERNAL_LABEL): Undefine.
+	* pa.h (ASM_OUTPUT_LABEL): Output colon when using GAS.
+	(ASM_OUTPUT_INTERNAL_LABEL): Define.
+
+2007-01-11  Zdenek Dvorak <dvorakz@suse.cz>
+
+	* tree-ssa-loop-ivopts.c (extract_cond_operands): Split from
+	find_interesting_uses_cond.
+	(find_interesting_uses_cond): Use extract_cond_operands.
+	(rewrite_use_compare): Use extract_cond_operands and
+	force_gimple_operand_bsi.  Do not call update_stmt.
+	(determine_use_iv_cost_condition): Use extract_cond_operands.
+	Return cheaper of using original bound and changing the exit bound.
+
+2007-01-11  Zdenek Dvorak <dvorakz@suse.cz>
+
+	PR tree-optimization/29516
+	* tree-ssa-address.c (tree_mem_ref_addr, add_to_parts,
+	most_expensive_mult_to_index, addr_to_parts,
+	create_mem_ref, maybe_fold_tmr): Make the type of
+	fields of TARGET_MEM_REF sizetype.
+	(move_fixed_address_to_symbol, move_pointer_to_base):
+	New functions.
+	* tree.def (TARGET_MEM_REF): Add comment on types of
+	the operands.
+
+2007-01-11  Joseph Myers  <joseph@codesourcery.com>
+
+	* c-common.c (vector_types_convertible_p): Treat opaque types as
+	always convertible if they have the same size, but not otherwise.
+
+2007-01-11  Steven Bosscher  <steven@gcc.gnu.org>
+
+	* ifcvt.c (struct noce_if_info): Add comments to the fields.
+	Remove the b_unconditional field.
+	(noce_try_sign_mask): Do not look at b_unconditional.
+	(noce_process_if_block): Do not use merge_if_blocks.  Update
+	the CFG here.  Do not set b_unconditional.
+	(cond_move_process_if_block): Likewise.
+	(find_cond_trap): Likewise.
+	(check_cond_move_block): Require simple jump insns at the end
+	of the basic block.
+
+2007-01-11  Jan Hubicka  <jh@suse.cz>
+
+	PR tree-optimization/1046
+	* tree-tailcall.c (suitable_for_tail_call_opt_p): Use TREE_ADDRESSABLE
+	when alias info is not ready.
+	(pass_tail_recursion): Do not require aliasing.
+	* tree-ssa-copyrename.c (pass_rename_ssa_cop): Likewise.
+	* tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Likewise.
+	* tree-ssa-copy.c (pass_copy_prop): Likewise.
+	* tree-ssa-forwprop.c (pass_forwprop): Likewise.
+	* tree-ssa-dce.c (pass_dce, pass_dce_loop, pass_cd_dce): Likewise.
+	* passes.c (init_optimization_passes): Execute rename_ssa_copies,
+	ccp, forwprop, copy_prop, merge_phi, copy_prop, dce and tail recursion
+	before inlining.
+	* tree-ssa-operands.c (add_virtual_operand, get_indirect_ref_operand):
+	When aliasing is not build, mark statement as volatile.
+
+2007-01-11  Tom Tromey  <tromey@redhat.com>
+
+	PR preprocessor/15185, PR preprocessor/20989:
+	* doc/cppopts.texi <-MT>: Update description of algorithm for
+	computing default target.
+	<-M, -MD>: Reword "basename" text.
+
 2007-01-11  Roger Sayle  <roger@eyesopen.com>
 
 	* builtins.c (expand_builtin_pow, expand_builtin_powi,
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-01-11 14:42:01.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-01-12 08:03:04.000000000 +0000
@@ -1,3 +1,8 @@
+2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
+
+	PR c++/29573
+	* tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
+
 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
 
 	PR c++/28999


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]