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 combine.c compilation at -O0 level:
    Overall memory needed: 24812k -> 24816k
    Peak memory use before GGC: 9651k
    Peak memory use after GGC: 8964k
    Maximum of released memory in single GGC run: 2791k
    Garbage: 42454k
    Leak: 6726k -> 6723k
    Overhead: 5935k -> 5933k
    GGC runs: 330

comparing combine.c compilation at -O1 level:
    Overall memory needed: 27636k -> 27640k
    Peak memory use before GGC: 9178k
    Peak memory use after GGC: 8748k
    Maximum of released memory in single GGC run: 2204k
    Garbage: 63520k
    Leak: 7091k -> 7089k
    Overhead: 7711k -> 7709k
    GGC runs: 525

comparing combine.c compilation at -O2 level:
    Overall memory needed: 24936k
    Peak memory use before GGC: 18412k
    Peak memory use after GGC: 18224k
    Maximum of released memory in single GGC run: 2522k
    Garbage: 88852k -> 88851k
    Leak: 7040k -> 7039k
    Overhead: 11049k -> 11047k
    GGC runs: 484

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage decreased from 123668k to 118585k, overall -4.29%
    Overall memory needed: 25704k -> 25208k
    Peak memory use before GGC: 18623k -> 18422k
    Peak memory use after GGC: 18224k
    Maximum of released memory in single GGC run: 3404k -> 3093k
    Garbage: 123668k -> 118585k
    Leak: 7135k -> 7112k
    Overhead: 15277k -> 14662k
    GGC runs: 544 -> 538

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 85596k
    Peak memory use before GGC: 73853k
    Peak memory use after GGC: 45357k
    Maximum of released memory in single GGC run: 37612k
    Garbage: 154701k
    Leak: 11538k -> 11537k
    Overhead: 20071k -> 20070k
    GGC runs: 268

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 101424k
    Peak memory use before GGC: 77259k
    Peak memory use after GGC: 66358k
    Maximum of released memory in single GGC run: 37102k
    Garbage: 307192k -> 307192k
    Leak: 11600k -> 11599k
    Overhead: 37679k -> 37678k
    GGC runs: 385

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 153692k -> 153684k
    Peak memory use before GGC: 120533k
    Peak memory use after GGC: 94158k
    Maximum of released memory in single GGC run: 32951k
    Garbage: 410818k -> 410820k
    Leak: 11438k -> 11434k
    Overhead: 51078k -> 51077k
    GGC runs: 307

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 153652k -> 153644k
    Peak memory use before GGC: 120535k
    Peak memory use after GGC: 94160k
    Maximum of released memory in single GGC run: 32951k
    Garbage: 411609k -> 411611k
    Leak: 11456k -> 11455k
    Overhead: 51202k -> 51201k
    GGC runs: 312

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 127372k
    Peak memory use before GGC: 103134k
    Peak memory use after GGC: 102097k
    Maximum of released memory in single GGC run: 20902k
    Garbage: 248307k -> 248271k
    Leak: 53806k -> 53785k
    Overhead: 43210k -> 43154k
    GGC runs: 347

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of memory still referenced at the end of compilation increased from 57780k to 58432k, overall 1.13%
    Overall memory needed: 122780k -> 121732k
    Peak memory use before GGC: 113480k -> 113021k
    Peak memory use after GGC: 100997k
    Maximum of released memory in single GGC run: 20054k
    Garbage: 682520k -> 665444k
    Leak: 57780k -> 58432k
    Overhead: 87920k -> 85585k
    GGC runs: 519 -> 515

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of memory still referenced at the end of compilation increased from 58789k to 59217k, overall 0.73%
    Overall memory needed: 122780k -> 121700k
    Peak memory use before GGC: 113480k -> 113021k
    Peak memory use after GGC: 100997k
    Maximum of released memory in single GGC run: 20054k -> 20053k
    Garbage: 795046k -> 772513k
    Leak: 58789k -> 59217k
    Overhead: 107944k -> 105202k
    GGC runs: 617 -> 614

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 115563k to 115802k, overall 0.21%
  Amount of produced GGC garbage increased from 817764k to 825680k, overall 0.97%
  Amount of memory still referenced at the end of compilation increased from 59468k to 60408k, overall 1.58%
    Overall memory needed: 124496k -> 125540k
    Peak memory use before GGC: 115563k -> 115802k
    Peak memory use after GGC: 102656k
    Maximum of released memory in single GGC run: 21391k -> 21453k
    Garbage: 817764k -> 825680k
    Leak: 59468k -> 60408k
    Overhead: 111106k -> 111562k
    GGC runs: 617 -> 608

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-05-25 11:01:30.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-05-25 13:58:17.000000000 +0000
@@ -1,3 +1,37 @@
+2005-05-25  Adrian Straetling  <straetling@de.ibm.com>
+
+	* config/s390/s390.c (TARGET_INSN_VALID_WITHIN_DOLOOP): Set to
+	hook_bool_rtx_true.
+
+2005-05-25  Jan Hubicka  <jh@suse.cz>
+
+	* Makefile.in (ipa-inline.o): Add COEVERAGE_H dependency.
+	* cgraph.c (cgraph_create_node): Reset estimated_growth.
+	* cgraph.h (cgraph_global_info): Add estimated_growth.
+	* ipa-inline.c: Include coverage.h
+	(max_insns, max_count): New static variables.
+	(cgraph_estimate_size_after_inlining): Cache the result.
+	(cgraph_estimate_growth):
+	* passes.c (rest_of_clean_state): Kill coverage_end_function.
+	* timevar.def (TV_INLINE_HEURISTICS): New timevar.
+	* tree-optimize.c (init_tree_optimization_passes): Move profiling before
+	inlining.
+	(ipa_passes): Initialize bitmaps.
+
+2005-05-25  Adrian Straetling  <straetling@de.ibm.com>
+
+	* loop-doloop.c: Include "target.h". 
+	  (doloop_valid_p): Move tests to function in targhooks.c.
+	* target.h (struct gcc_target): New target hook
+	  "insn_valid_within_doloop".
+	* target-def.h: Define default value for "insn_valid_within_doloop".
+	  (TARGET_INITIALIZER): Insert new target hook into initializer.
+	* targhooks.c (default_insn_valid_within_doloop): New function.
+	* targhooks.h (default_insn_valid_within_doloop): Declare.
+	* hooks.c (hook_bool_rtx_true): New function.
+	* hooks.h (hook_bool_rtx_true): Declare.
+	* doc/tm.texi: Add documentation for new target hook.
+
 2005-05-25  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
 	PR target/21412


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]