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: 18223k -> 18227k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 421k
    Leak: 2266k
    Overhead: 445k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
  Peak amount of GGC memory still allocated after garbage collectin increased from 1961k to 1963k, overall 0.10%
    Overall memory needed: 18239k -> 18243k
    Peak memory use before GGC: 2254k -> 2256k
    Peak memory use after GGC: 1961k -> 1963k
    Maximum of released memory in single GGC run: 293k
    Garbage: 424k
    Leak: 2296k -> 2298k
    Overhead: 448k -> 449k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 18327k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 427k
    Leak: 2269k
    Overhead: 445k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 18339k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 430k
    Leak: 2269k
    Overhead: 446k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 18339k
    Peak memory use before GGC: 2229k
    Peak memory use after GGC: 1936k
    Maximum of released memory in single GGC run: 293k
    Garbage: 430k
    Leak: 2269k
    Overhead: 446k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
    Overall memory needed: 28407k -> 28411k
    Peak memory use before GGC: 9304k
    Peak memory use after GGC: 8843k
    Maximum of released memory in single GGC run: 2666k
    Garbage: 36845k
    Leak: 6454k
    Overhead: 4862k
    GGC runs: 280

comparing combine.c compilation at -O0 -g level:
  Peak amount of GGC memory allocated before garbage collecting increased from 10818k to 10834k, overall 0.15%
  Peak amount of GGC memory still allocated after garbage collectin increased from 10448k to 10464k, overall 0.15%
  Amount of memory still referenced at the end of compilation increased from 9175k to 9214k, overall 0.43%
    Overall memory needed: 30467k -> 30507k
    Peak memory use before GGC: 10818k -> 10834k
    Peak memory use after GGC: 10448k -> 10464k
    Maximum of released memory in single GGC run: 2420k
    Garbage: 37420k -> 37410k
    Leak: 9175k -> 9214k
    Overhead: 5484k -> 5497k
    GGC runs: 270 -> 271

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40251k
    Peak memory use before GGC: 17292k
    Peak memory use after GGC: 17117k
    Maximum of released memory in single GGC run: 2332k
    Garbage: 57470k
    Leak: 6508k
    Overhead: 6220k
    GGC runs: 356

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29802k
    Peak memory use before GGC: 17288k
    Peak memory use after GGC: 17117k
    Maximum of released memory in single GGC run: 2869k
    Garbage: 74938k
    Leak: 6614k
    Overhead: 8476k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28902k
    Peak memory use before GGC: 18417k
    Peak memory use after GGC: 17846k
    Maximum of released memory in single GGC run: 4106k
    Garbage: 112681k
    Leak: 6684k
    Overhead: 13027k
    GGC runs: 463

    Overall memory needed: 28407k -> 28411k
    Peak memory use before GGC: 9304k
    Peak memory use after GGC: 8843k
    Maximum of released memory in single GGC run: 2666k
    Garbage: 36845k
    Leak: 6454k
    Overhead: 4862k
    GGC runs: 280

comparing combine.c compilation at -O1 level:
    Overall memory needed: 40251k
    Peak memory use before GGC: 17292k
    Peak memory use after GGC: 17117k
    Maximum of released memory in single GGC run: 2332k
    Garbage: 57470k
    Leak: 6508k
    Overhead: 6220k
    GGC runs: 356

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29802k
    Peak memory use before GGC: 17288k
    Peak memory use after GGC: 17117k
    Maximum of released memory in single GGC run: 2869k
    Garbage: 74938k
    Leak: 6614k
    Overhead: 8476k
    GGC runs: 413

comparing combine.c compilation at -O3 level:
    Overall memory needed: 28902k
    Peak memory use before GGC: 18417k
    Peak memory use after GGC: 17846k
    Maximum of released memory in single GGC run: 4106k
    Garbage: 112681k
    Leak: 6684k
    Overhead: 13027k
    GGC runs: 463

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 88242k
    Peak memory use before GGC: 69788k
    Peak memory use after GGC: 44198k
    Maximum of released memory in single GGC run: 36963k
    Garbage: 129062k
    Leak: 9514k
    Overhead: 16996k
    GGC runs: 216

comparing insn-attrtab.c compilation at -O0 -g level:
  Amount of memory still referenced at the end of compilation increased from 10889k to 10913k, overall 0.22%
    Overall memory needed: 89406k -> 89422k
    Peak memory use before GGC: 70910k -> 70926k
    Peak memory use after GGC: 45426k -> 45442k
    Maximum of released memory in single GGC run: 36965k
    Garbage: 130490k -> 130490k
    Leak: 10889k -> 10913k
    Overhead: 17344k -> 17357k
    GGC runs: 212

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 112882k -> 112878k
    Peak memory use before GGC: 90374k
    Peak memory use after GGC: 83736k
    Maximum of released memory in single GGC run: 31852k
    Garbage: 277771k
    Leak: 9357k
    Overhead: 29782k
    GGC runs: 222

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 119758k -> 119754k
    Peak memory use before GGC: 92604k
    Peak memory use after GGC: 84716k
    Maximum of released memory in single GGC run: 30394k
    Garbage: 317208k
    Leak: 9359k
    Overhead: 36365k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 129418k
    Peak memory use before GGC: 92629k
    Peak memory use after GGC: 84742k
    Maximum of released memory in single GGC run: 30581k
    Garbage: 318070k
    Leak: 9362k
    Overhead: 36601k
    GGC runs: 249

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 119550k
    Peak memory use before GGC: 92691k
    Peak memory use after GGC: 91771k
    Maximum of released memory in single GGC run: 19314k
    Garbage: 205599k
    Leak: 47691k
    Overhead: 20819k
    GGC runs: 401

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 132422k -> 132454k
    Peak memory use before GGC: 105067k -> 105108k
    Peak memory use after GGC: 104026k -> 104059k
    Maximum of released memory in single GGC run: 19474k -> 19491k
    Garbage: 212185k -> 212182k
    Leak: 70052k -> 70089k
    Overhead: 26134k -> 26148k
    GGC runs: 377

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 119302k
    Peak memory use before GGC: 97860k
    Peak memory use after GGC: 95650k
    Maximum of released memory in single GGC run: 18600k
    Garbage: 443668k
    Leak: 50024k
    Overhead: 32734k
    GGC runs: 551

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 119294k
    Peak memory use before GGC: 97860k
    Peak memory use after GGC: 95650k
    Maximum of released memory in single GGC run: 18600k
    Garbage: 501735k
    Leak: 50707k
    Overhead: 39818k
    GGC runs: 605

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 118926k
    Peak memory use before GGC: 97906k
    Peak memory use after GGC: 96936k
    Maximum of released memory in single GGC run: 18847k
    Garbage: 523878k
    Leak: 50282k
    Overhead: 40826k
    GGC runs: 620

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 137958k -> 137786k
    Peak memory use before GGC: 81909k
    Peak memory use after GGC: 58788k
    Maximum of released memory in single GGC run: 45493k
    Garbage: 147243k
    Leak: 7536k
    Overhead: 25302k
    GGC runs: 82

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 138130k -> 138134k
    Peak memory use before GGC: 82526k -> 82530k
    Peak memory use after GGC: 59405k -> 59409k
    Maximum of released memory in single GGC run: 45558k
    Garbage: 147414k -> 147413k
    Leak: 9178k -> 9184k
    Overhead: 25734k -> 25737k
    GGC runs: 88

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 424422k -> 424262k
    Peak memory use before GGC: 205229k
    Peak memory use after GGC: 201005k
    Maximum of released memory in single GGC run: 101903k
    Garbage: 271986k
    Leak: 47601k
    Overhead: 31280k
    GGC runs: 101

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 352034k -> 352058k
    Peak memory use before GGC: 206002k
    Peak memory use after GGC: 201778k
    Maximum of released memory in single GGC run: 108808k
    Garbage: 352211k
    Leak: 48184k
    Overhead: 47025k
    GGC runs: 110

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 781466k -> 781306k
    Peak memory use before GGC: 314925k
    Peak memory use after GGC: 293268k
    Maximum of released memory in single GGC run: 165331k
    Garbage: 494373k
    Leak: 65517k
    Overhead: 59915k
    GGC runs: 98

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-11-14 19:16:34.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-11-15 11:48:46.000000000 +0000
@@ -1,3 +1,73 @@
+2006-11-15  Jakub Jelinek  <jakub@redhat.com>
+
+	PR tree-optimization/29581
+	* lambda-code.c (replace_uses_equiv_to_x_with_y): Add YINIT,
+	REPLACEMENTS, FIRSTBSI arguments.  If initial condition or
+	type is different between Y and USE, create a temporary
+	variable, initialize it at the beginning of the body bb
+	and use it as replacement instead of Y.
+
+2006-11-15  Paolo Bonzini  <bonzini@gnu.org>
+
+	PR middle-end/29753
+	* gimplify.c (fold_indirect_ref_rhs): Use
+	STRIP_USELESS_TYPE_CONVERSION rather than STRIP_NOPS.
+
+2006-11-14  Richard Earnshaw  <rearnsha@arm.com>
+
+	* expmed.c (emit_store_flag_1): New function.
+	(emit_store_flag): Call it.  If we can't find a suitable scc insn,
+	try a cstore insn.
+	* expr.c (do_store_flag): If we can't find a scc insn, try cstore.
+	Use do_compare_rtx_and_jump.
+	* arm.h (BRANCH_COST): Increase to 2 on Thumb.
+	* arm.md (cstoresi4): New define_expand.
+	(cstoresi_eq0_thumb, cstoresi_ne0_thumb): Likewise.
+	(cstoresi_eq0_thumb_insn, cstore_ne0_thumb_insn): New patterns.
+	(cstoresi_nltu_thumb, thumb_addsi3_addgeu): New patterns.
+
+2006-11-14  Caroline Tice  <ctice@apple.com>
+		
+	* dwarf2out.c (debug_pubtypes_section): New static global variable.
+	(pubname_entry):  Add DEF_VEC_O and DEF_VEC_ALLOC_O statements for
+	this type.
+	(pubname_table):  Redefine as a vector.
+	(pubtype_table):  New static global variable, defined as a vector.
+	(pubname_table_allocated): Remove static global variable.
+	(pubname_table_in_use): Remove static global variable.
+	(PUBNAME_TABLE_INCREMENT): Remove constant.
+	(size_of_pubnames): Add parameter to deal with either pubnames or 
+	pubtypes, and change code to deal with table being a vector.
+	(add_pubname):  Change to deal with table being a vector.
+	(add_pubtype):  New function.
+	(output_pubnames): Add parameter to deal with either pubnames or 
+	pubtypes, and change code to deal with table being a vector.
+	(gen_array_type_die):  Add call to add_pubtype.
+	(gen_enumeration_type_die): Add call to add_pubtype.
+	(gen_struct_or_union_type_die): Add call to add_pubtype.
+	(gen_subroutine_type_die): Add call to add_pubtype.
+	(gen_typedef_die):  Add call to add_pubtype.
+	(dwarf2out_init): Add code to initialize pubname_table and 
+	pubtype_table vectors; also initialize debug_pubtypes_section.
+	(prune_unused_types):  Change to deal with pubnames being a vector.
+	(dwarf2out_finish): Change to deal with pubnames being a vector; add 
+	pubnames table to call to output_pubnames;  Add code to output pubtypes 
+	table if DEBUG_PUBTYPES_SECTION is defined.
+	* config/darwin.c (darwin_file_start):  Add DEBUG_PUBTYPES_SECTION to 
+	debugnames.
+	* config/darwin.h (DEBUG_PUBTYPES_SECTION): Define new global variable.
+
+2006-11-14  Joseph Myers  <joseph@codesourcery.com>
+
+	* config/arm/arm.h (FUNCTION_ARG_ADVANCE): Only adjust
+	iwmmxt_nregs if TARGET_IWMMXT_ABI.
+	* config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
+	movv2si_internal): Support moves between core registers.
+
+2006-11-14  Eric Christopher  <echristo@apple.com>
+
+	* configure: Regenerate with autoconf 2.59.
+
 2006-11-14  Daniel Berlin  <dberlin@dberlin.org>
 
 	Fix PR tree-optimization/27755
@@ -61,7 +131,7 @@
 2006-11-13  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
 	* config/rs6000/cell.md: New file.
-	* config/rs6000/rs6000.c (rs6000_cell_dont_microcode): New 
+	* config/rs6000/rs6000.c (rs6000_cell_dont_microcode): New
 	variable.
 	(ppccell_cost): New cost matrix.
 	(TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Define.


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]