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: 8331k -> 8330k
    Peak memory use before GGC: 3394k
    Peak memory use after GGC: 3042k
    Maximum of released memory in single GGC run: 352k
    Garbage: 525k
    Leak: 3797k
    Overhead: 915k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 8347k -> 8346k
    Peak memory use before GGC: 3422k
    Peak memory use after GGC: 3069k
    Maximum of released memory in single GGC run: 353k
    Garbage: 527k
    Leak: 3829k
    Overhead: 919k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 8387k -> 8386k
    Peak memory use before GGC: 3394k
    Peak memory use after GGC: 3042k
    Maximum of released memory in single GGC run: 352k
    Garbage: 527k
    Leak: 3797k
    Overhead: 915k
    GGC runs: 3

comparing empty function compilation at -O2 level:
    Overall memory needed: 8391k -> 8390k
    Peak memory use before GGC: 3395k
    Peak memory use after GGC: 3042k
    Maximum of released memory in single GGC run: 353k
    Garbage: 531k
    Leak: 3798k
    Overhead: 916k
    GGC runs: 3

comparing empty function compilation at -O3 level:
    Overall memory needed: 8391k -> 8390k
    Peak memory use before GGC: 3395k
    Peak memory use after GGC: 3042k
    Maximum of released memory in single GGC run: 353k
    Garbage: 531k
    Leak: 3798k
    Overhead: 916k
    GGC runs: 3

comparing combine.c compilation at -O0 level:
    Overall memory needed: 23751k -> 23750k
    Peak memory use before GGC: 10321k
    Peak memory use after GGC: 9565k
    Maximum of released memory in single GGC run: 1902k
    Garbage: 39098k
    Leak: 8847k
    Overhead: 5786k
    GGC runs: 254

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 25623k -> 25622k
    Peak memory use before GGC: 11982k
    Peak memory use after GGC: 11357k
    Maximum of released memory in single GGC run: 1516k
    Garbage: 39442k
    Leak: 11748k
    Overhead: 6491k
    GGC runs: 250

comparing combine.c compilation at -O1 level:
    Overall memory needed: 35715k -> 35742k
    Peak memory use before GGC: 18983k
    Peak memory use after GGC: 18793k
    Maximum of released memory in single GGC run: 1375k
    Garbage: 52572k -> 52592k
    Leak: 8993k
    Overhead: 6747k -> 6749k
    GGC runs: 321

comparing combine.c compilation at -O2 level:
    Overall memory needed: 37679k -> 37742k
    Peak memory use before GGC: 19037k
    Peak memory use after GGC: 18847k
    Maximum of released memory in single GGC run: 1409k
    Garbage: 70961k -> 70982k
    Leak: 9320k
    Overhead: 8862k -> 8864k
    GGC runs: 383

comparing combine.c compilation at -O3 level:
    Overall memory needed: 40595k -> 40594k
    Peak memory use before GGC: 19311k
    Peak memory use after GGC: 18964k
    Maximum of released memory in single GGC run: 2262k
    Garbage: 92914k -> 92935k
    Leak: 9441k
    Overhead: 11491k -> 11492k
    GGC runs: 412

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 140099k -> 140098k
    Peak memory use before GGC: 60579k
    Peak memory use after GGC: 34072k
    Maximum of released memory in single GGC run: 34144k
    Garbage: 132014k
    Leak: 11585k
    Overhead: 15588k
    GGC runs: 197

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 141351k -> 141354k
    Peak memory use before GGC: 61741k
    Peak memory use after GGC: 35233k
    Maximum of released memory in single GGC run: 34145k
    Garbage: 132242k
    Leak: 13293k
    Overhead: 15986k
    GGC runs: 199

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 150223k -> 150234k
    Peak memory use before GGC: 59100k
    Peak memory use after GGC: 52849k
    Maximum of released memory in single GGC run: 24232k
    Garbage: 212964k
    Leak: 12479k
    Overhead: 25582k
    GGC runs: 222

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 188919k -> 188918k
    Peak memory use before GGC: 59722k
    Peak memory use after GGC: 54428k
    Maximum of released memory in single GGC run: 22887k
    Garbage: 254073k
    Leak: 13560k
    Overhead: 31305k
    GGC runs: 249

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 195879k -> 195878k
    Peak memory use before GGC: 71706k
    Peak memory use after GGC: 65139k
    Maximum of released memory in single GGC run: 23329k
    Garbage: 281239k
    Leak: 13571k
    Overhead: 33104k
    GGC runs: 252

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 156622k -> 156546k
    Peak memory use before GGC: 91627k
    Peak memory use after GGC: 90710k
    Maximum of released memory in single GGC run: 17988k
    Garbage: 210867k -> 210867k
    Leak: 55683k
    Overhead: 27052k -> 27053k
    GGC runs: 396 -> 397

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 177722k -> 177690k
    Peak memory use before GGC: 104595k -> 104561k
    Peak memory use after GGC: 103551k -> 103523k
    Maximum of released memory in single GGC run: 18703k -> 18669k
    Garbage: 216712k -> 216714k
    Leak: 79111k
    Overhead: 33020k -> 33021k
    GGC runs: 373

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 93614k to 96156k, overall 2.72%
  Peak amount of GGC memory still allocated after garbage collecting increased from 92687k to 95202k, overall 2.71%
  Amount of produced GGC garbage increased from 318250k to 319654k, overall 0.44%
  Amount of memory still referenced at the end of compilation increased from 55561k to 55781k, overall 0.40%
    Overall memory needed: 133436k -> 135292k
    Peak memory use before GGC: 93614k -> 96156k
    Peak memory use after GGC: 92687k -> 95202k
    Maximum of released memory in single GGC run: 17367k -> 17368k
    Garbage: 318250k -> 319654k
    Leak: 55561k -> 55781k
    Overhead: 32816k -> 33223k
    GGC runs: 499 -> 498

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Overall memory allocated via mmap and sbrk increased from 141852k to 145040k, overall 2.25%
  Peak amount of GGC memory allocated before garbage collecting increased from 94124k to 96089k, overall 2.09%
  Peak amount of GGC memory still allocated after garbage collecting increased from 93188k to 95137k, overall 2.09%
  Amount of produced GGC garbage increased from 375274k to 379111k, overall 1.02%
  Amount of memory still referenced at the end of compilation increased from 56790k to 57027k, overall 0.42%
    Overall memory needed: 141852k -> 145040k
    Peak memory use before GGC: 94124k -> 96089k
    Peak memory use after GGC: 93188k -> 95137k
    Maximum of released memory in single GGC run: 17371k -> 17372k
    Garbage: 375274k -> 379111k
    Leak: 56790k -> 57027k
    Overhead: 39152k -> 39586k
    GGC runs: 558 -> 561

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 145256k to 148672k, overall 2.35%
  Peak amount of GGC memory allocated before garbage collecting increased from 95147k to 97699k, overall 2.68%
  Peak amount of GGC memory still allocated after garbage collecting increased from 94062k to 96614k, overall 2.71%
  Amount of produced GGC garbage increased from 415914k to 417870k, overall 0.47%
  Amount of memory still referenced at the end of compilation increased from 57188k to 57337k, overall 0.26%
    Overall memory needed: 145256k -> 148672k
    Peak memory use before GGC: 95147k -> 97699k
    Peak memory use after GGC: 94062k -> 96614k
    Maximum of released memory in single GGC run: 17786k -> 17787k
    Garbage: 415914k -> 417870k
    Leak: 57188k -> 57337k
    Overhead: 42471k -> 42927k
    GGC runs: 587 -> 584

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 381009k
    Peak memory use before GGC: 103475k
    Peak memory use after GGC: 59129k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179674k
    Leak: 9009k
    Overhead: 31654k
    GGC runs: 65

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 381829k
    Peak memory use before GGC: 104121k
    Peak memory use after GGC: 59775k
    Maximum of released memory in single GGC run: 50582k
    Garbage: 179835k
    Leak: 10777k
    Overhead: 32150k
    GGC runs: 72

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 289991k -> 290234k
    Peak memory use before GGC: 82783k
    Peak memory use after GGC: 75171k
    Maximum of released memory in single GGC run: 40018k
    Garbage: 236071k
    Leak: 18347k
    Overhead: 32719k
    GGC runs: 69

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 277755k -> 279554k
    Peak memory use before GGC: 80157k
    Peak memory use after GGC: 75171k
    Maximum of released memory in single GGC run: 33751k
    Garbage: 246134k
    Leak: 18436k
    Overhead: 34945k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1012807k -> 1012346k
    Peak memory use before GGC: 168799k
    Peak memory use after GGC: 158363k
    Maximum of released memory in single GGC run: 83495k
    Garbage: 356480k
    Leak: 28510k
    Overhead: 46899k
    GGC runs: 65

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-08-22 06:55:52.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-08-22 22:33:48.000000000 +0000
@@ -1,3 +1,91 @@
+2007-08-22  Hans-Peter Nilsson  <hp@axis.com>
+
+	* doc/md.texi (Iterators): Renamed from Macros.  All contents
+	changed to reflect rename of respectively define_code_macro and
+	define_mode_macro to define_code_iterator and define_mode_iterator.
+	(Mode Iterators, Code Iterators): Similar.
+	* read-rtl.c (struct iterator_group, struct iterator_traverse_data)
+	(uses_mode_iterator_p, apply_mode_iterator, uses_code_iterator_p)
+	(apply_iterator_to_string, uses_iterator_p, apply_iterator_traverse)
+	(initialize_iterators, find_iterator, check_code_iterator)
+	(map_attr_string, apply_mode_maps, apply_iterator_to_rtx, add_mapping)
+	(read_mapping, read_rtx_1): Similar.
+	* config/alpha/sync.md, config/alpha/alpha.md, config/frv/frv.md,
+	config/s390/s390.md, config/m32c/blkmov.md, config/m32c/m32c.md,
+	config/spu/spu.md, config/sparc/sparc.md, config/sparc/sync.md,
+	config/i386/i386.md, config/i386/mmx.md, config/i386/sse.md,
+	config/i386/sync.md, config/crx/crx.md, config/xtensa/xtensa.md,
+	config/cris/cris.c, config/cris/cris.md, config/ia64/sync.md,
+	config/ia64/div.md, config/ia64/vect.md, config/ia64/ia64.md,
+	config/m68k/m68k.md, config/rs6000/spe.md, config/rs6000/altivec.md,
+	config/rs6000/sync.md, config/rs6000/rs6000.md,
+	config/arm/vec-common.md, config/arm/neon.md, config/arm/iwmmxt.md,
+	config/arm/arm.md, config/mips/mips-dsp.md, config/mips/mips.md,
+	config/vax/vax.md, config/bfin/bfin.md: Similar.
+
+2007-08-22  David Daney  <ddaney@avtrex.com>
+
+	* doc/install.texi (Testing): Mention testing on a simulator.
+
+2007-08-22  Janis Johnson  <janis187@us.ibm.com>
+
+	* config/dfp-bit.c (DFP_TO_DFP): Check for overflow.
+
+	* doc/libgcc.texi (Decimal float library routines): Fix formatting
+	and rearrange floating point conversion functions into different
+	categories.
+
+2007-08-22  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+	* target.h (struct gcc_target.sched: dfa_pre_advance_cycle,
+	dfa_post_advance_cycle): New scheduler hooks.
+	* target-def.h (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE,
+	TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): New macros to initialize
+	new hooks.
+	(TARGET_SCHED): Use them.
+	* doc/tm.texi (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE,
+	TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Document new hooks.
+	* haifa-sched.c (advance_one_cycle): Invoke new hooks.
+
+	* genautomata.c (insn_has_dfa_reservation_p): New DFA interface
+	function to facilitate debugging.
+	(INSN_HAS_DFA_RESERVATION_P_FUNC_NAME): New macro.
+	(output_insn_has_dfa_reservation_p): New static function to output
+	insn_has_dfa_reservation_p ().
+	(write_automata): Use it.
+	* genattr.c (main): Output declaration for
+	insn_has_dfa_reservation_p ().
+
+2007-08-22  Christian Bruel  <christian.bruel@st.com>	
+            Richard Guenther <rguenther@suse.de>
+	
+	* fold-const.c (fold_binary): Optimize A-A if -ffinite-math-only.
+	* simplify_rtx (simplify_binary_operation_1): Likewise.
+		
+2007-08-22  Rask Ingemann Lambertsen  <rask@sygehus.dk>
+
+	PR rtl-optimization/32557
+	* df-problems.c (df_note_bb_compute): Use mws->start_regno instead
+	of REGNO (mws->mw_reg).
+
+2007-08-22  Richard Guenther  <rguenther@suse.de>
+
+	PR middle-end/33007
+	* builtins.c (expand_builtin_int_roundingfn): Replace call
+	argument wrapped with SAVE_EXPR directly.
+	(expand_builtin_int_roundingfn_2): Likewise.
+
+2007-08-22  Richard Guenther  <rguenther@suse.de>
+
+	* tree-inline.c (inlinable_function_p): Restore disregarding
+	inline limits for GNU extern inline functions.
+
+2007-08-22  Richard Guenther  <rguenther@suse.de>
+
+	PR middle-end/32563
+	* tree.c (host_integerp): Treat sizetype as signed as it is
+	sign-extended.
+
 2007-08-21  Ian Lance Taylor  <iant@google.com>
 
 	PR tree-optimization/33134
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-08-22 06:55:51.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-08-22 22:33:43.000000000 +0000
@@ -1,3 +1,12 @@
+2007-08-22  Jason Merrill  <jason@redhat.com>
+
+	PR c++/29365
+	* pt.c (outermost_tinst_level): New function.
+	* lex.c (in_main_input_context): New function.
+	* cp-tree.h: Declare it.
+	* decl2.c (constrain_class_visibility): Use it to avoid warning
+	about uses of the anonymous namespace in the main input file.
+
 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
 
 	* init.c (build_new_1): Use get_target_expr instead of save_expr.
@@ -939,7 +948,6 @@
 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
 
 	PR c++/29365
-
 	* cp/decl2.c (constrain_class_visibility):
 	Do not warn about the use of anonymous namespace in the main input file.
 


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]