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: 7383k -> 7384k
    Peak memory use before GGC: 2269k
    Peak memory use after GGC: 1958k
    Maximum of released memory in single GGC run: 311k
    Garbage: 446k
    Leak: 2292k
    Overhead: 456k
    GGC runs: 3

comparing empty function compilation at -O0 -g level:
    Overall memory needed: 7399k -> 7400k
    Peak memory use before GGC: 2297k
    Peak memory use after GGC: 1986k
    Maximum of released memory in single GGC run: 311k
    Garbage: 449k
    Leak: 2325k
    Overhead: 461k
    GGC runs: 3

comparing empty function compilation at -O1 level:
    Overall memory needed: 7515k -> 7512k
    Peak memory use before GGC: 2269k
    Peak memory use after GGC: 1958k
    Maximum of released memory in single GGC run: 311k
    Garbage: 452k
    Leak: 2295k
    Overhead: 457k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 7519k -> 7520k
    Peak memory use before GGC: 2270k
    Peak memory use after GGC: 1959k
    Maximum of released memory in single GGC run: 311k
    Garbage: 455k
    Leak: 2295k
    Overhead: 457k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 7519k -> 7520k
    Peak memory use before GGC: 2270k
    Peak memory use after GGC: 1959k
    Maximum of released memory in single GGC run: 311k
    Garbage: 455k
    Leak: 2295k
    Overhead: 457k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 6579k to 6587k, overall 0.12%
    Overall memory needed: 17879k -> 17848k
    Peak memory use before GGC: 9277k -> 9271k
    Peak memory use after GGC: 8859k
    Maximum of released memory in single GGC run: 2584k -> 2578k
    Garbage: 37118k -> 36907k
    Leak: 6579k -> 6587k
    Overhead: 5037k -> 5037k
    GGC runs: 279

comparing combine.c compilation at -O0 -g level:
    Overall memory needed: 19891k -> 19868k
    Peak memory use before GGC: 10887k
    Peak memory use after GGC: 10519k
    Maximum of released memory in single GGC run: 2355k
    Garbage: 37710k -> 37492k
    Leak: 9480k
    Overhead: 5744k -> 5743k
    GGC runs: 269 -> 268

comparing combine.c compilation at -O1 level:
    Overall memory needed: 35283k -> 35284k
    Peak memory use before GGC: 19350k
    Peak memory use after GGC: 19135k
    Maximum of released memory in single GGC run: 2170k -> 2169k
    Garbage: 57434k -> 57238k
    Leak: 6616k -> 6616k
    Overhead: 6375k -> 6375k
    GGC runs: 351 -> 350

comparing combine.c compilation at -O2 level:
    Overall memory needed: 37587k -> 37588k
    Peak memory use before GGC: 19387k
    Peak memory use after GGC: 19185k
    Maximum of released memory in single GGC run: 2158k -> 2157k
    Garbage: 68704k -> 68517k
    Leak: 6725k -> 6725k
    Overhead: 7999k -> 8001k
    GGC runs: 403 -> 402

comparing combine.c compilation at -O3 level:
    Overall memory needed: 46971k -> 47008k
    Peak memory use before GGC: 20423k
    Peak memory use after GGC: 19542k -> 19541k
    Maximum of released memory in single GGC run: 3130k -> 3147k
    Garbage: 101173k -> 101022k
    Leak: 6861k -> 6865k
    Overhead: 12237k -> 12243k
    GGC runs: 454 -> 452

comparing insn-attrtab.c compilation at -O0 level:
  Amount of memory still referenced at the end of compilation increased from 9350k to 9590k, overall 2.57%
    Overall memory needed: 103215k -> 102944k
    Peak memory use before GGC: 68882k -> 68633k
    Peak memory use after GGC: 44737k
    Maximum of released memory in single GGC run: 36678k -> 36429k
    Garbage: 130211k -> 129358k
    Leak: 9350k -> 9590k
    Overhead: 16801k -> 16801k
    GGC runs: 206

comparing insn-attrtab.c compilation at -O0 -g level:
    Overall memory needed: 104611k -> 104336k
    Peak memory use before GGC: 70043k -> 69795k
    Peak memory use after GGC: 46005k
    Maximum of released memory in single GGC run: 36678k -> 36430k
    Garbage: 131174k -> 130585k
    Leak: 11298k
    Overhead: 17198k -> 17198k
    GGC runs: 206

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 147607k -> 147608k
    Peak memory use before GGC: 85871k
    Peak memory use after GGC: 80078k
    Maximum of released memory in single GGC run: 32745k -> 32814k
    Garbage: 264141k -> 263559k
    Leak: 9410k
    Overhead: 27490k -> 27491k
    GGC runs: 225

comparing insn-attrtab.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 298867k to 300063k, overall 0.40%
    Overall memory needed: 193207k -> 196484k
    Peak memory use before GGC: 87187k
    Peak memory use after GGC: 80148k
    Maximum of released memory in single GGC run: 31097k -> 30016k
    Garbage: 298867k -> 300063k
    Leak: 9407k
    Overhead: 33067k -> 33191k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 299492k to 300728k, overall 0.41%
    Overall memory needed: 191159k -> 192592k
    Peak memory use before GGC: 87204k -> 87200k
    Peak memory use after GGC: 80165k -> 80161k
    Maximum of released memory in single GGC run: 31097k -> 30079k
    Garbage: 299492k -> 300728k
    Leak: 9411k -> 9412k
    Overhead: 33261k -> 33391k
    GGC runs: 245

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 147673k -> 147362k
    Peak memory use before GGC: 90479k -> 90250k
    Peak memory use after GGC: 89583k -> 89356k
    Maximum of released memory in single GGC run: 18003k -> 17775k
    Garbage: 209330k -> 207698k
    Leak: 49053k -> 49052k
    Overhead: 23532k -> 23534k
    GGC runs: 414 -> 411

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
    Overall memory needed: 165629k -> 165170k
    Peak memory use before GGC: 103211k -> 102855k
    Peak memory use after GGC: 102187k -> 101837k
    Maximum of released memory in single GGC run: 18485k -> 18129k
    Garbage: 215834k -> 214180k
    Leak: 72366k
    Overhead: 29426k -> 29428k
    GGC runs: 386 -> 383

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 141921k -> 141893k
    Peak memory use before GGC: 101817k -> 101823k
    Peak memory use after GGC: 100800k
    Maximum of released memory in single GGC run: 17237k
    Garbage: 345862k -> 344114k
    Leak: 49773k -> 49762k
    Overhead: 30070k -> 30049k
    GGC runs: 529 -> 526

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 143869k -> 143801k
    Peak memory use before GGC: 102489k
    Peak memory use after GGC: 101444k
    Maximum of released memory in single GGC run: 17234k
    Garbage: 374346k -> 372859k
    Leak: 50755k -> 50745k
    Overhead: 33972k -> 33995k
    GGC runs: 561

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 146657k -> 146393k
    Peak memory use before GGC: 104251k -> 104252k
    Peak memory use after GGC: 103218k
    Maximum of released memory in single GGC run: 17651k -> 17610k
    Garbage: 393319k -> 390252k
    Leak: 51057k -> 51037k
    Overhead: 35560k -> 35344k
    GGC runs: 577 -> 571

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 244755k -> 244620k
    Peak memory use before GGC: 80969k
    Peak memory use after GGC: 58708k
    Maximum of released memory in single GGC run: 44133k
    Garbage: 145362k -> 144295k
    Leak: 7619k
    Overhead: 24814k
    GGC runs: 79

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 245579k -> 245424k
    Peak memory use before GGC: 81615k
    Peak memory use after GGC: 59354k
    Maximum of released memory in single GGC run: 44123k
    Garbage: 145629k -> 144570k
    Leak: 9387k
    Overhead: 25310k -> 25310k
    GGC runs: 89

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 246095k -> 245212k
    Peak memory use before GGC: 85141k
    Peak memory use after GGC: 74853k
    Maximum of released memory in single GGC run: 36136k
    Garbage: 223655k -> 222588k
    Leak: 20863k
    Overhead: 30547k
    GGC runs: 81

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 499351k -> 498396k
    Peak memory use before GGC: 79840k
    Peak memory use after GGC: 74854k
    Maximum of released memory in single GGC run: 33434k -> 33438k
    Garbage: 230701k -> 229631k
    Leak: 20953k
    Overhead: 32630k -> 32629k
    GGC runs: 91

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 1189139k -> 1187344k
    Peak memory use before GGC: 201756k
    Peak memory use after GGC: 190218k
    Maximum of released memory in single GGC run: 80702k
    Garbage: 376738k -> 375646k
    Leak: 46318k -> 46318k
    Overhead: 49361k -> 49354k
    GGC runs: 70

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-02-28 03:52:00.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-02-28 20:36:04.000000000 +0000
@@ -1,3 +1,30 @@
+2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* builtins.c (fold_builtin_call_list, fold_builtin_call_valist):
+	Delete, and replace with...
+	(fold_builtin_call_array): This.  Update callers to use it.
+	* fold-const.c (fold_build_call_list): Delete, and replace with...
+	(fold_build_call_array): This.
+	(fold_build_call_list_initializer): Delete, and replace with...
+	(fold_build_call_array_initializer): This.
+	* tree.h: Update declarations to reflect above changes.
+
+	* c-typeck.c (build_function_call): Store converted arguments
+	in a stack-allocated array instead of building a list.
+	(convert_arguments): Store arguments in the array passed in as an
+	argument, and return the actual number of arguments.
+	* c-format.c: (check_function_format): Pass arguments in an
+	array instead of a list.
+	* c-common.c (check_function_nonnull): Likewise.
+	(check_function_sentinel): Likewise.
+	(check_function_arguments): Likewise.
+	* c-common.h: Update declarations to reflect above changes.
+
+2007-02-28  Jan Hubicka  <jh@suse.cz>
+
+	* predict.def (PRED_TREE_EARLY_RETURN, PRED_CONST_RETURN,
+	PRED_NEGATIVE_RETURN): Update outcomes.
+
 2007-02-28  Bernd Schmidt  <bernd.schmidt@analog.com>
 
 	* calls.c (emit_library_call_value_1): Handle partial registers
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-02-27 11:07:22.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-02-28 20:36:02.000000000 +0000
@@ -1,3 +1,30 @@
+2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* typeck.c (build_function_call): Store converted arguments
+	in a stack-allocated array instead of building a list.
+	(convert_arguments): Store arguments in the array passed in as an
+	argument, and return the actual number of arguments.
+	* call.c (build_call): Delete, and replace with...
+	(build_call_n, build_call_a): New.
+	(build_op_delete_call): Rewrite to avoid constructing argument lists.
+	(build_over_call): Store converted arguments in a stack-allocated
+	array instead of building a list.
+	(build_cxx_call): Pass arguments in an array instead of as a list.
+	(build_java_interface_fn_ref): Rewrite to avoid constructing
+	argument lists.
+	* tree.h: Update declarations to reflect above changes.
+	* method.c (use_thunk): Use a stack-allocated array to hold
+	the arguments instead of a list.
+	* rtti.c (throw_bad_cast): Update call to cxx_call.
+	(throw_bad_typeid): Likewise.
+	(build_dynamic_cast_1): Likewise.
+	* init.c (build_builtin_delete_call): Use build_call_n.
+	* decl.c (expand_static_init): Likewise.
+	* except.c (cp_protect_cleanup_actions): Likewise.
+	* cp-gimplify.c (genericize_eh_spec_block): Likewise.
+	(gimplify_must_not_throw_expr): Likewise.
+	(cxx_omp_apply_fn): Use build_call_a.
+
 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
 
 	* semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.


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]