This is the mail archive of the
gcc-regression@gcc.gnu.org
mailing list for the GCC project.
A recent patch increased GCC's memory consumption!
- From: gcctest at suse dot de
- To: jh at suse dot cz, gcc-regression at gcc dot gnu dot org
- Date: Tue, 28 Nov 2006 12:56:29 +0000
- Subject: 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: 18269k -> 18273k
Peak memory use before GGC: 2233k
Peak memory use after GGC: 1940k
Maximum of released memory in single GGC run: 293k
Garbage: 421k
Leak: 2271k -> 2271k
Overhead: 446k -> 446k
GGC runs: 3
comparing empty function compilation at -O0 -g level:
Overall memory needed: 18285k -> 18289k
Peak memory use before GGC: 2260k
Peak memory use after GGC: 1967k
Maximum of released memory in single GGC run: 293k
Garbage: 424k
Leak: 2303k -> 2303k
Overhead: 450k -> 450k
GGC runs: 3
comparing empty function compilation at -O1 level:
Overall memory needed: 18369k -> 18373k
Peak memory use before GGC: 2233k
Peak memory use after GGC: 1940k
Maximum of released memory in single GGC run: 293k
Garbage: 427k
Leak: 2274k -> 2274k
Overhead: 446k -> 446k
GGC runs: 4
comparing empty function compilation at -O2 level:
Overall memory needed: 18381k -> 18385k
Peak memory use before GGC: 2233k
Peak memory use after GGC: 1940k
Maximum of released memory in single GGC run: 293k
Garbage: 430k
Leak: 2274k -> 2274k
Overhead: 447k -> 447k
GGC runs: 4
comparing empty function compilation at -O3 level:
Overall memory needed: 18381k -> 18385k
Peak memory use before GGC: 2233k
Peak memory use after GGC: 1940k
Maximum of released memory in single GGC run: 293k
Garbage: 430k
Leak: 2274k -> 2274k
Overhead: 447k -> 447k
GGC runs: 4
comparing combine.c compilation at -O0 level:
Amount of memory still referenced at the end of compilation increased from 6449k to 6480k, overall 0.49%
Overall memory needed: 28457k -> 28477k
Peak memory use before GGC: 9309k -> 9313k
Peak memory use after GGC: 8848k -> 8852k
Maximum of released memory in single GGC run: 2665k
Garbage: 36866k -> 36831k
Leak: 6449k -> 6480k
Overhead: 4869k -> 4867k
GGC runs: 279 -> 280
comparing combine.c compilation at -O0 -g level:
Overall memory needed: 30553k -> 30569k
Peak memory use before GGC: 10859k -> 10863k
Peak memory use after GGC: 10488k -> 10493k
Maximum of released memory in single GGC run: 2415k
Garbage: 37410k -> 37427k
Leak: 9287k -> 9274k
Overhead: 5537k -> 5535k
GGC runs: 271
comparing combine.c compilation at -O1 level:
Amount of memory still referenced at the end of compilation increased from 6515k to 6524k, overall 0.15%
Overall memory needed: 40301k -> 40305k
Peak memory use before GGC: 17299k -> 17306k
Peak memory use after GGC: 17124k -> 17131k
Maximum of released memory in single GGC run: 2274k -> 2328k
Garbage: 57475k -> 57465k
Leak: 6515k -> 6524k
Overhead: 6227k -> 6224k
GGC runs: 356 -> 355
comparing combine.c compilation at -O2 level:
Overall memory needed: 29806k -> 29810k
Peak memory use before GGC: 17295k -> 17299k
Peak memory use after GGC: 17124k -> 17128k
Maximum of released memory in single GGC run: 2869k
Garbage: 74901k -> 74904k
Leak: 6621k -> 6614k
Overhead: 8477k -> 8475k
GGC runs: 412
comparing combine.c compilation at -O3 level:
Overall memory needed: 28906k -> 28910k
Peak memory use before GGC: 18423k -> 18428k
Peak memory use after GGC: 17851k -> 17856k
Maximum of released memory in single GGC run: 4100k -> 4096k
Garbage: 112604k -> 112606k
Leak: 6688k -> 6686k
Overhead: 13023k -> 13020k
GGC runs: 462
Amount of memory still referenced at the end of compilation increased from 6449k to 6480k, overall 0.49%
Overall memory needed: 28457k -> 28477k
Peak memory use before GGC: 9309k -> 9313k
Peak memory use after GGC: 8848k -> 8852k
Maximum of released memory in single GGC run: 2665k
Garbage: 36866k -> 36831k
Leak: 6449k -> 6480k
Overhead: 4869k -> 4867k
GGC runs: 279 -> 280
comparing combine.c compilation at -O1 level:
Amount of memory still referenced at the end of compilation increased from 6515k to 6524k, overall 0.15%
Overall memory needed: 40301k -> 40305k
Peak memory use before GGC: 17299k -> 17306k
Peak memory use after GGC: 17124k -> 17131k
Maximum of released memory in single GGC run: 2274k -> 2328k
Garbage: 57475k -> 57465k
Leak: 6515k -> 6524k
Overhead: 6227k -> 6224k
GGC runs: 356 -> 355
comparing combine.c compilation at -O2 level:
Overall memory needed: 29806k -> 29810k
Peak memory use before GGC: 17295k -> 17299k
Peak memory use after GGC: 17124k -> 17128k
Maximum of released memory in single GGC run: 2869k
Garbage: 74901k -> 74904k
Leak: 6621k -> 6614k
Overhead: 8477k -> 8475k
GGC runs: 412
comparing combine.c compilation at -O3 level:
Overall memory needed: 28906k -> 28910k
Peak memory use before GGC: 18423k -> 18428k
Peak memory use after GGC: 17851k -> 17856k
Maximum of released memory in single GGC run: 4100k -> 4096k
Garbage: 112604k -> 112606k
Leak: 6688k -> 6686k
Overhead: 13023k -> 13020k
GGC runs: 462
comparing insn-attrtab.c compilation at -O0 level:
Overall memory needed: 88246k
Peak memory use before GGC: 69793k -> 69795k
Peak memory use after GGC: 44203k -> 44205k
Maximum of released memory in single GGC run: 36964k
Garbage: 129064k -> 129062k
Leak: 9520k -> 9522k
Overhead: 17002k -> 17001k
GGC runs: 216
comparing insn-attrtab.c compilation at -O0 -g level:
Amount of produced GGC garbage increased from 130219k to 130473k, overall 0.19%
Overall memory needed: 89298k -> 89430k
Peak memory use before GGC: 70942k -> 70944k
Peak memory use after GGC: 45459k -> 45461k
Maximum of released memory in single GGC run: 36964k
Garbage: 130219k -> 130473k
Leak: 11191k -> 10943k
Overhead: 17380k -> 17379k
GGC runs: 212
comparing insn-attrtab.c compilation at -O1 level:
Overall memory needed: 114182k -> 114194k
Peak memory use before GGC: 90379k -> 90380k
Peak memory use after GGC: 83741k -> 83742k
Maximum of released memory in single GGC run: 31852k
Garbage: 277773k -> 277773k
Leak: 9362k -> 9363k
Overhead: 29792k -> 29791k
GGC runs: 221
comparing insn-attrtab.c compilation at -O2 level:
Overall memory needed: 129402k -> 129350k
Peak memory use before GGC: 92608k -> 92609k
Peak memory use after GGC: 84720k -> 84721k
Maximum of released memory in single GGC run: 30398k -> 30397k
Garbage: 317195k -> 317194k
Leak: 9364k -> 9365k
Overhead: 36371k -> 36370k
GGC runs: 243
comparing insn-attrtab.c compilation at -O3 level:
Overall memory needed: 129406k -> 129370k
Peak memory use before GGC: 92634k -> 92636k
Peak memory use after GGC: 84746k -> 84748k
Maximum of released memory in single GGC run: 30585k
Garbage: 318050k -> 318051k
Leak: 9367k -> 9368k
Overhead: 36606k -> 36605k
GGC runs: 247
comparing Gerald's testcase PR8361 compilation at -O0 level:
Overall memory needed: 120002k -> 119898k
Peak memory use before GGC: 93309k -> 93193k
Peak memory use after GGC: 92385k -> 92260k
Maximum of released memory in single GGC run: 20012k -> 19356k
Garbage: 207553k -> 207571k
Leak: 47730k -> 47752k
Overhead: 20977k -> 20921k
GGC runs: 408
comparing Gerald's testcase PR8361 compilation at -O0 -g level:
Peak amount of GGC memory allocated before garbage collecting increased from 105440k to 106437k, overall 0.95%
Peak amount of GGC memory still allocated after garbage collectin increased from 104390k to 105383k, overall 0.95%
Overall memory needed: 132502k -> 133518k
Peak memory use before GGC: 105440k -> 106437k
Peak memory use after GGC: 104390k -> 105383k
Maximum of released memory in single GGC run: 19645k -> 20416k
Garbage: 214146k -> 214171k
Leak: 70689k -> 70714k
Overhead: 26594k -> 26537k
GGC runs: 380
comparing Gerald's testcase PR8361 compilation at -O1 level:
Peak amount of GGC memory allocated before garbage collecting increased from 97923k to 98256k, overall 0.34%
Peak amount of GGC memory still allocated after garbage collectin increased from 95711k to 95974k, overall 0.27%
Overall memory needed: 119134k -> 119490k
Peak memory use before GGC: 97923k -> 98256k
Peak memory use after GGC: 95711k -> 95974k
Maximum of released memory in single GGC run: 18552k -> 18601k
Garbage: 446397k -> 446720k
Leak: 50111k -> 49756k
Overhead: 32789k -> 32635k
GGC runs: 559
comparing Gerald's testcase PR8361 compilation at -O2 level:
Peak amount of GGC memory allocated before garbage collecting increased from 97924k to 98072k, overall 0.15%
Overall memory needed: 119162k -> 119350k
Peak memory use before GGC: 97924k -> 98072k
Peak memory use after GGC: 95711k -> 95790k
Maximum of released memory in single GGC run: 18552k -> 18623k
Garbage: 505732k -> 504692k
Leak: 50796k -> 50418k
Overhead: 39996k -> 39649k
GGC runs: 613 -> 620
comparing Gerald's testcase PR8361 compilation at -O3 level:
Overall memory needed: 118994k -> 119458k
Peak memory use before GGC: 97968k -> 98048k
Peak memory use after GGC: 96997k -> 97077k
Maximum of released memory in single GGC run: 18932k -> 19002k
Garbage: 526749k -> 526931k
Leak: 50369k -> 50373k
Overhead: 40909k -> 40791k
GGC runs: 627
comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
Overall memory needed: 137962k
Peak memory use before GGC: 81913k
Peak memory use after GGC: 58792k -> 58793k
Maximum of released memory in single GGC run: 45493k
Garbage: 147244k -> 147243k
Leak: 7541k -> 7541k
Overhead: 25304k -> 25304k
GGC runs: 82
comparing PR rtl-optimization/28071 testcase compilation at -O0 -g level:
Overall memory needed: 138138k
Peak memory use before GGC: 82546k
Peak memory use after GGC: 59426k
Maximum of released memory in single GGC run: 45558k -> 45559k
Garbage: 147414k -> 147414k
Leak: 9249k -> 9249k
Overhead: 25770k -> 25769k
GGC runs: 88
comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
Peak amount of GGC memory allocated before garbage collecting increased from 205233k to 206841k, overall 0.78%
Peak amount of GGC memory still allocated after garbage collectin increased from 201009k to 202617k, overall 0.80%
Amount of produced GGC garbage increased from 272165k to 272489k, overall 0.12%
Amount of memory still referenced at the end of compilation increased from 47606k to 49254k, overall 3.46%
Overall memory needed: 424330k -> 427910k
Peak memory use before GGC: 205233k -> 206841k
Peak memory use after GGC: 201009k -> 202617k
Maximum of released memory in single GGC run: 101913k -> 101927k
Garbage: 272165k -> 272489k
Leak: 47606k -> 49254k
Overhead: 31282k -> 31427k
GGC runs: 101 -> 99
comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
Overall memory needed: 352386k -> 351734k
Peak memory use before GGC: 206006k
Peak memory use after GGC: 201782k
Maximum of released memory in single GGC run: 108818k -> 108819k
Garbage: 352391k -> 352464k
Leak: 48189k -> 48189k
Overhead: 47027k -> 46953k
GGC runs: 110
comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
Overall memory needed: 781462k -> 781218k
Peak memory use before GGC: 314929k
Peak memory use after GGC: 293272k
Maximum of released memory in single GGC run: 165211k -> 165210k
Garbage: 494413k -> 494498k
Leak: 65522k -> 65522k
Overhead: 59885k -> 59799k
GGC runs: 98
Head of the ChangeLog is:
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog 2006-11-27 18:41:58.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog 2006-11-28 11:12:55.000000000 +0000
@@ -1,3 +1,55 @@
+2006-11-28 Jan Hubicka <jh@suse.cz>
+
+ * invoke.texi (large-stack-frame, large-stack-frame-growth): New params.
+ * cgraph.c (dump_cgraph_node): Dump stack usage.
+ * cgraph.h (cgraph_local_info): Add estimated_self_stack_size.
+ (cgraph_global_info): Add estimated_stack_size and stack_frame_offset.
+ * cgraphunit.c (cgraph_analyze_function): Analyze stack sizes.
+ * ipa-inline.c (cgraph_clone_inlined_nodes): Propagate stack usage.
+ (cgraph_check_inline_limits): Limit stack growth.
+ * cfgexpand.c: Include tree-inline.h.
+ (account_stack_vars): New function.
+ (expand_one_var): New param to just account the stack; return estimated
+ size.
+ (expand_used_vars_for_block): Update call of expand_one_var.
+ (account_used_vars_for_block): New function.
+ (estimated_stack_frame_size): Likewise.
+ (init_vars_expansion, fini_vars_expansion): Break out from..
+ (expand_used_vars): ... here.
+ * tree-inline.h (estimated_stack_frame_size): Declare.
+ * params.def (PARAM_LARGE_STACK_FRAME, PARAM_STACK_FRAME_GROWTH): New.
+
+2006-11-28 Richard Guenther <rguenther@suse.de>
+
+ * ggc-page.c (ggc_print_statistics): Use %ul and a cast to
+ unsigned long for printing OBJECT_SIZE.
+
+2006-11-27 Steven Bosscher <steven@gcc.gnu.org>
+
+ * alias.c (init_alias_analysis): Remove simplification loop
+ after propagating pointers.
+
+2006-11-27 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (x86_ext_80387_constants): Add m_K8, m_CORE2
+ and m_GENERIC64.
+
+2006-11-27 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.h (XCHAL_HAVE_MUL32_HIGH): Provide default.
+
+2006-11-27 Roger Sayle <roger@eyesopen.com>
+ Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * c-common.c (constant_fits_type_p): Delete.
+ (unsigned_conversion_warning): Delete.
+ (conversion_warning): Integrate Wconversion warning from
+ unsigned_conversion_warning.
+ (convert_and_check): Integrate Woverflow warning from
+ unsigned_conversion_warning. Reorganize and simplify to avoid
+ dependence upon the middle-end setting TREE_OVERFLOW on integral
+ conversions, by using int_fits_type_p directly.
+
2006-11-27 Tobias Burnus <burnus@net-b.de>
* doc/invoke.texi: Fixed typo.
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp 2006-11-27 18:41:56.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog 2006-11-28 11:12:55.000000000 +0000
@@ -1,3 +1,8 @@
+2006-11-27 Mark Mitchell <mark@codesourcery.com>
+
+ * class.c (build_vcall_offset_vtbl_entries): Do not add vcall
+ entries for a primary construction virtual table.
+
2006-11-26 Mark Mitchell <mark@codesourcery.com>
PR c++/29886
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.