Some aspect of GCC memory consumption increased by recent patch

gcctest@suse.de gcctest@suse.de
Thu Jan 27 18:35:00 GMT 2005


Hi,
Comparing memory consumption on compilation of combine.i and generate-3.4.ii I got:


comparing combine.c compilation at -O0 level:
    Overall memory needed: 24617k -> 24621k
    Peak memory use before GGC: 9345k
    Peak memory use after GGC: 8659k
    Maximum of released memory in single GGC run: 2864k
    Garbage: 41677k
    Leak: 6395k
    Overhead: 5774k
    GGC runs: 329

comparing combine.c compilation at -O1 level:
  Ovarall memory allocated via mmap and sbrk decreased from 26705k to 25441k, overall -4.97%
  Peak amount of GGC memory still allocated after garbage collectin increased from 8716k to 8727k, overall 0.13%
  Amount of produced GGC garbage decreased from 65948k to 61401k, overall -7.40%
    Overall memory needed: 26705k -> 25441k
    Peak memory use before GGC: 9223k -> 9222k
    Peak memory use after GGC: 8716k -> 8727k
    Maximum of released memory in single GGC run: 2023k -> 2024k
    Garbage: 65948k -> 61401k
    Leak: 6749k -> 6740k
    Overhead: 10433k -> 10012k
    GGC runs: 520 -> 504

comparing combine.c compilation at -O2 level:
    Overall memory needed: 29489k -> 29493k
    Peak memory use before GGC: 12656k
    Peak memory use after GGC: 12530k
    Maximum of released memory in single GGC run: 2550k
    Garbage: 80064k
    Leak: 6572k
    Overhead: 14267k
    GGC runs: 523

comparing combine.c compilation at -O3 level:
    Overall memory needed: 20212k
    Peak memory use before GGC: 12784k
    Peak memory use after GGC: 12530k
    Maximum of released memory in single GGC run: 3348k
    Garbage: 108214k
    Leak: 7082k
    Overhead: 19133k
    GGC runs: 590

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 114132k
    Peak memory use before GGC: 74734k
    Peak memory use after GGC: 45480k
    Maximum of released memory in single GGC run: 39341k
    Garbage: 152710k
    Leak: 10950k
    Overhead: 19973k
    GGC runs: 274

comparing insn-attrtab.c compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 83493k to 78742k, overall -6.03%
  Peak amount of GGC memory still allocated after garbage collectin increased from 69209k to 70089k, overall 1.27%
  Amount of produced GGC garbage decreased from 435208k to 367913k, overall -18.29%
  Amount of memory still referenced at the end of compilation increased from 11294k to 11327k, overall 0.29%
    Overall memory needed: 125156k -> 124560k
    Peak memory use before GGC: 83493k -> 78742k
    Peak memory use after GGC: 69209k -> 70089k
    Maximum of released memory in single GGC run: 40528k -> 40766k
    Garbage: 435208k -> 367913k
    Leak: 11294k -> 11327k
    Overhead: 76677k -> 69574k
    GGC runs: 406 -> 401

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 147340k
    Peak memory use before GGC: 98331k
    Peak memory use after GGC: 83448k
    Maximum of released memory in single GGC run: 39290k
    Garbage: 481611k
    Leak: 11225k
    Overhead: 84770k
    GGC runs: 342

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 148976k
    Peak memory use before GGC: 98333k
    Peak memory use after GGC: 83449k
    Maximum of released memory in single GGC run: 39291k
    Garbage: 482646k
    Leak: 11263k
    Overhead: 84917k
    GGC runs: 348

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 111084k
    Peak memory use before GGC: 86881k
    Peak memory use after GGC: 85930k
    Maximum of released memory in single GGC run: 19284k
    Garbage: 246347k -> 246352k
    Leak: 55490k
    Overhead: 43354k -> 43354k
    GGC runs: 368

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 104613k -> 103645k
    Peak memory use before GGC: 85963k
    Peak memory use after GGC: 84927k
    Maximum of released memory in single GGC run: 18947k
    Garbage: 456770k -> 446476k
    Leak: 56821k -> 56770k
    Overhead: 66415k -> 65671k
    GGC runs: 541 -> 527

comparing Gerald's testcase PR8361 compilation at -O2 level:
    Overall memory needed: 104673k
    Peak memory use before GGC: 85963k
    Peak memory use after GGC: 84928k
    Maximum of released memory in single GGC run: 18947k
    Garbage: 491586k -> 491547k
    Leak: 57393k -> 57401k
    Overhead: 75804k -> 75802k
    GGC runs: 590

comparing Gerald's testcase PR8361 compilation at -O3 level:
    Overall memory needed: 112393k
    Peak memory use before GGC: 92701k
    Peak memory use after GGC: 86221k
    Maximum of released memory in single GGC run: 19712k
    Garbage: 507069k -> 507068k
    Leak: 57569k
    Overhead: 77419k -> 77419k
    GGC runs: 575

Head of changelog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2005-01-27 12:01:07.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2005-01-27 17:33:47.000000000 +0000
@@ -1,3 +1,29 @@
+2005-01-27  Steven Bosscher  <stevenb@suse.de>
+
+	PR middle-end/17278
+	* opts.c (decode_options): Move flag_thread_jumps from -O1 and
+	higher to -O2 and higher.  Likewise for tree PRE.
+	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Only iterate at -O2
+	and better.
+
+2005-01-27  Ian Lance Taylor  <ian@c2micro.com>
+
+	PR middle-end/19583
+	* gimple-low.c (try_catch_may_fallthru): New static function.
+	(block_may_fallthru): Handle TRY_CATCH_EXPR.
+	* tree-inline.c (expand_call_inline): Don't warn about reaching
+	the end of a non-void function being inlined if the function uses
+	a return slot.
+
+2005-01-27  Jakub Jelinek  <jakub@redhat.com>
+
+	* config/i386/i386.h (CALL_USED_REGISTERS): Fix comment pastos.
+
+	PR c/18946
+	* c-decl.c (warn_if_shadowing): Handle old_decl error_mark_node.
+	(pushdecl): Only use DECL_FILE_SCOPE_P if DECL_P.
+	(implicitly_declare): Handle error_mark_node.
+
 2005-01-27  Richard Henderson  <rth@redhat.com>
 
 	PR tree-opt/14329

I am friendly script caring about memory consumption in GCC.  Please contact
jh@suse.cz if something is going wrong.

The results can be reproduced by building 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.

Yours testing script.



More information about the Gcc-regression mailing list