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 empty function compilation at -O0 level:
    Overall memory needed: 7384k -> 7385k
    Peak memory use before GGC: 2260k
    Peak memory use after GGC: 1949k
    Maximum of released memory in single GGC run: 311k
    Garbage: 446k -> 446k
    Leak: 2283k -> 2283k
    Overhead: 456k
    GGC runs: 3

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

comparing empty function compilation at -O1 level:
    Overall memory needed: 7508k -> 7509k
    Peak memory use before GGC: 2260k
    Peak memory use after GGC: 1949k
    Maximum of released memory in single GGC run: 311k
    Garbage: 452k
    Leak: 2286k
    Overhead: 457k
    GGC runs: 4

comparing empty function compilation at -O2 level:
    Overall memory needed: 7576k -> 7577k
    Peak memory use before GGC: 2261k
    Peak memory use after GGC: 1950k
    Maximum of released memory in single GGC run: 311k
    Garbage: 455k
    Leak: 2286k
    Overhead: 457k
    GGC runs: 4

comparing empty function compilation at -O3 level:
    Overall memory needed: 7576k -> 7577k
    Peak memory use before GGC: 2261k
    Peak memory use after GGC: 1950k
    Maximum of released memory in single GGC run: 311k
    Garbage: 455k
    Leak: 2286k
    Overhead: 457k
    GGC runs: 4

comparing combine.c compilation at -O0 level:
  Amount of produced GGC garbage increased from 36909k to 37145k, overall 0.64%
    Overall memory needed: 17836k -> 17725k
    Peak memory use before GGC: 9262k
    Peak memory use after GGC: 8849k
    Maximum of released memory in single GGC run: 2578k
    Garbage: 36909k -> 37145k
    Leak: 6578k -> 6578k
    Overhead: 5037k -> 5053k
    GGC runs: 279 -> 283

comparing combine.c compilation at -O0 -g level:
  Amount of produced GGC garbage increased from 37491k to 37718k, overall 0.60%
    Overall memory needed: 19856k -> 19861k
    Peak memory use before GGC: 10878k -> 10877k
    Peak memory use after GGC: 10509k
    Maximum of released memory in single GGC run: 2354k -> 2351k
    Garbage: 37491k -> 37718k
    Leak: 9471k
    Overhead: 5743k -> 5759k
    GGC runs: 268 -> 269

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 56722k to 56935k, overall 0.38%
    Overall memory needed: 35264k -> 35253k
    Peak memory use before GGC: 19340k -> 19341k
    Peak memory use after GGC: 19125k
    Maximum of released memory in single GGC run: 2172k -> 2177k
    Garbage: 56722k -> 56935k
    Leak: 6607k
    Overhead: 6304k -> 6319k
    GGC runs: 352 -> 353

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage increased from 68222k to 68466k, overall 0.36%
  Amount of memory still referenced at the end of compilation increased from 6718k to 6726k, overall 0.11%
    Overall memory needed: 37568k -> 37517k
    Peak memory use before GGC: 19371k
    Peak memory use after GGC: 19177k
    Maximum of released memory in single GGC run: 2159k -> 2164k
    Garbage: 68222k -> 68466k
    Leak: 6718k -> 6726k
    Overhead: 8029k -> 8044k
    GGC runs: 405 -> 406

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage increased from 101149k to 101491k, overall 0.34%
    Overall memory needed: 46896k -> 46893k
    Peak memory use before GGC: 20389k
    Peak memory use after GGC: 19559k
    Maximum of released memory in single GGC run: 3148k -> 3141k
    Garbage: 101149k -> 101491k
    Leak: 6864k -> 6863k
    Overhead: 12251k -> 12268k
    GGC runs: 455 -> 456

comparing insn-attrtab.c compilation at -O0 level:
  Amount of produced GGC garbage increased from 129360k to 131233k, overall 1.45%
    Overall memory needed: 102952k -> 102965k
    Peak memory use before GGC: 68624k
    Peak memory use after GGC: 44728k
    Maximum of released memory in single GGC run: 36429k
    Garbage: 129360k -> 131233k
    Leak: 9581k -> 9581k
    Overhead: 16801k -> 16927k
    GGC runs: 208 -> 212

comparing insn-attrtab.c compilation at -O0 -g level:
  Amount of produced GGC garbage increased from 130583k to 132452k, overall 1.43%
    Overall memory needed: 104336k -> 104205k
    Peak memory use before GGC: 69786k
    Peak memory use after GGC: 45996k
    Maximum of released memory in single GGC run: 36430k
    Garbage: 130583k -> 132452k
    Leak: 11289k
    Overhead: 17199k -> 17324k
    GGC runs: 206 -> 209

comparing insn-attrtab.c compilation at -O1 level:
  Amount of produced GGC garbage increased from 264361k to 265261k, overall 0.34%
    Overall memory needed: 147596k -> 147593k
    Peak memory use before GGC: 85946k
    Peak memory use after GGC: 80068k
    Maximum of released memory in single GGC run: 32841k -> 32842k
    Garbage: 264361k -> 265261k
    Leak: 9401k
    Overhead: 27621k -> 27688k
    GGC runs: 226 -> 227

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 196408k -> 191633k
    Peak memory use before GGC: 87233k
    Peak memory use after GGC: 80138k
    Maximum of released memory in single GGC run: 30034k -> 30051k
    Garbage: 301511k -> 301443k
    Leak: 9399k
    Overhead: 33447k -> 33331k
    GGC runs: 248

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 196440k -> 193465k
    Peak memory use before GGC: 87247k
    Peak memory use after GGC: 80152k
    Maximum of released memory in single GGC run: 30095k -> 30112k
    Garbage: 302153k -> 302090k
    Leak: 9404k
    Overhead: 33645k -> 33530k
    GGC runs: 248 -> 247

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Amount of produced GGC garbage increased from 207698k to 208054k, overall 0.17%
    Overall memory needed: 174547k -> 174536k
    Peak memory use before GGC: 90285k
    Peak memory use after GGC: 89390k
    Maximum of released memory in single GGC run: 17776k
    Garbage: 207698k -> 208054k
    Leak: 49110k -> 49106k
    Overhead: 23556k -> 23578k
    GGC runs: 410 -> 411

comparing Gerald's testcase PR8361 compilation at -O0 -g level:
  Amount of produced GGC garbage increased from 214182k to 214600k, overall 0.20%
    Overall memory needed: 192359k -> 192372k
    Peak memory use before GGC: 102889k
    Peak memory use after GGC: 101870k
    Maximum of released memory in single GGC run: 18129k
    Garbage: 214182k -> 214600k
    Leak: 72423k -> 72419k
    Overhead: 29451k -> 29475k
    GGC runs: 383 -> 384

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Amount of produced GGC garbage increased from 344622k to 345295k, overall 0.20%
    Overall memory needed: 168983k -> 168988k
    Peak memory use before GGC: 101851k
    Peak memory use after GGC: 100834k
    Maximum of released memory in single GGC run: 17236k
    Garbage: 344622k -> 345295k
    Leak: 49818k
    Overhead: 30146k -> 30195k
    GGC runs: 526 -> 527

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage increased from 373517k to 374180k, overall 0.18%
    Overall memory needed: 171023k -> 171024k
    Peak memory use before GGC: 102466k -> 102472k
    Peak memory use after GGC: 101452k
    Maximum of released memory in single GGC run: 17233k
    Garbage: 373517k -> 374180k
    Leak: 50850k
    Overhead: 34086k -> 34134k
    GGC runs: 562

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage increased from 390876k to 391547k, overall 0.17%
    Overall memory needed: 173567k -> 173568k
    Peak memory use before GGC: 104288k -> 104284k
    Peak memory use after GGC: 103250k
    Maximum of released memory in single GGC run: 17610k
    Garbage: 390876k -> 391547k
    Leak: 51133k
    Overhead: 35453k -> 35503k
    GGC runs: 572

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 244576k -> 244569k
    Peak memory use before GGC: 80960k
    Peak memory use after GGC: 58699k
    Maximum of released memory in single GGC run: 44133k
    Garbage: 144343k -> 144344k
    Leak: 7611k -> 7611k
    Overhead: 24815k -> 24815k
    GGC runs: 79

comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
    Overall memory needed: 245408k -> 245409k
    Peak memory use before GGC: 81606k
    Peak memory use after GGC: 59345k
    Maximum of released memory in single GGC run: 44122k
    Garbage: 144514k -> 144515k
    Leak: 9378k
    Overhead: 25310k -> 25310k
    GGC runs: 89

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 245200k -> 245053k
    Peak memory use before GGC: 85157k
    Peak memory use after GGC: 74845k
    Maximum of released memory in single GGC run: 36137k
    Garbage: 222608k -> 222621k
    Leak: 20854k
    Overhead: 30547k -> 30548k
    GGC runs: 81

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
    Overall memory needed: 498772k -> 498669k
    Peak memory use before GGC: 79831k
    Peak memory use after GGC: 74845k
    Maximum of released memory in single GGC run: 33438k
    Garbage: 229655k -> 229668k
    Leak: 20944k
    Overhead: 32629k -> 32630k
    GGC runs: 91

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
  Overall memory allocated via mmap and sbrk increased from 1188296k to 1215445k, overall 2.28%
  Amount of produced GGC garbage decreased from 375660k to 363594k, overall -3.32%
    Overall memory needed: 1188296k -> 1215445k
    Peak memory use before GGC: 201747k
    Peak memory use after GGC: 190209k
    Maximum of released memory in single GGC run: 80701k -> 80686k
    Garbage: 375660k -> 363594k
    Leak: 46310k
    Overhead: 49354k -> 46513k
    GGC runs: 70 -> 71

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2007-03-12 14:48:43.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2007-03-13 07:16:03.000000000 +0000
@@ -1,3 +1,69 @@
+2007-03-11  Geoffrey Keating  <geoffk@apple.com>
+
+	* config/rs6000/darwin-fallback.c: Compile file only on powerpc.
+	(handle_syscall): Handle direct system calls.
+	* config/rs6000/darwin.h (HAS_MD_FALLBACK_FRAME_STATE_FOR): Delete.
+
+2007-03-12  Brooks Moses  <brooks.moses@codesourcery.com>
+
+	* doc/invoke.texi: Fix cpp.info cross-reference.
+	* doc/passes.texi: Fix gcc.info cross-reference.
+
+2007-03-12  Zdenek Dvorak  <dvorakz@suse.cz>
+
+	PR tree-optimization/30835
+	* lambda-code.c (can_convert_to_perfect_nest): Check whether
+	bb_for_stmt is not NULL before accessing it.
+
+2007-03-12  Joseph Myers  <joseph@codesourcery.com>
+
+	* gcc.c (main): Handle target_sysroot_hdrs_suffix being NULL for
+	some multilibs.
+
+2007-03-12  Brooks Moses  <brooks.moses@codesourcery.com>
+
+	PR 30635
+	* doc/install.texi: Document --enable-stage1-languages
+
+2007-03-12  Steven Bosscher  <steven@gcc.gnu.org>
+
+	* tree-pass.h (pass_into_cfg_layout_mode,
+	pass_outof_cfg_layout_mode): Declare.
+	* cfglayout.c (into_cfg_layout_mode, outof_cfg_layout_mode,
+	pass_into_cfg_layout_mode, pass_outof_cfg_layout_mode): New.
+	* passes.c (pass_into_cfg_layout_mode): Schedule before jump2.
+	(pass_outof_cfg_layout_mode): Schedule after pass_rtl_ifcvt.
+
+2007-03-12  Seongbae Park <seongbae.park@gmail.com>
+
+	* c-decl.c (warn_variable_length_array): New function.
+	Refactored from grokdeclarator to handle warn_vla
+	and handle unnamed array case.
+	(grokdeclarator): Refactored VLA warning case.
+	* c.opt (Wvla): New flag.
+	* doc/invoke.texi (Wvla): New warning.
+
+2007-03-12  Richard Henderson  <rth@redhat.com>
+
+	* config/alpha/alpha.c (alpha_elf_section_type_flags): New.
+	(TARGET_SECTION_TYPE_FLAGS): New.
+
+2007-03-12  Richard Henderson  <rth@redhat.com>
+
+	* config/darwin.c (machopic_reloc_rw_mask): New.
+	* config/darwin-protos.h (machopic_reloc_rw_mask): Declare.
+	* config/darwin.h (TARGET_ASM_RELOC_RW_MASK): New.
+
+2007-03-12  Mark Mitchell  <mark@codesourcery.com>
+
+	* cppdefault.c (cpp_EXEC_PREFIX): New variable.
+	* cppdefault.h (cpp_PREFIX): Document.
+	(cpp_PREFIX_len): Likewise.
+	(cpp_EXEC_PREFIX): New variable.
+	* Makefile.in (PREPROCESSOR_DEFINES): Add STANDARD_EXEC_PREFIX.
+	* c-incpath.c (add_standard_paths): Correct logic for relocating
+	paths within prefix.
+
 2007-03-12  Uros Bizjak  <ubizjak@gmail.com>
 
 	* config/i386/i386.md (fixuns_trunc<mode>hi2): Implement from
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2007-03-12 14:48:42.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2007-03-13 07:16:03.000000000 +0000
@@ -1,3 +1,12 @@
+2007-03-12  Seongbae Park <seongbae.park@gmail.com>
+
+	* decl.c (compute_array_index_type): New warning flag warn_vla.
+
+2007-03-12  Mark Mitchell  <mark@codesourcery.com>
+
+	PR c++/30108
+	* call.c (convert_default_arg): Copy non-constant arguments.
+
 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
 
 	PR c++/31038


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]