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 combine.c compilation at -O0 level:
    Overall memory needed: 25324k -> 25320k
    Peak memory use before GGC: 9566k
    Peak memory use after GGC: 8913k
    Maximum of released memory in single GGC run: 2649k
    Garbage: 40060k
    Leak: 6740k
    Overhead: 5738k
    GGC runs: 313

comparing combine.c compilation at -O1 level:
    Overall memory needed: 26892k
    Peak memory use before GGC: 17434k
    Peak memory use after GGC: 17255k
    Maximum of released memory in single GGC run: 2309k
    Garbage: 62589k -> 62589k
    Leak: 6889k
    Overhead: 7488k
    GGC runs: 393

comparing combine.c compilation at -O2 level:
    Overall memory needed: 26892k
    Peak memory use before GGC: 17436k
    Peak memory use after GGC: 17255k
    Maximum of released memory in single GGC run: 2388k
    Garbage: 80093k -> 80093k
    Leak: 6962k
    Overhead: 10032k
    GGC runs: 450

comparing combine.c compilation at -O3 level:
    Overall memory needed: 26892k
    Peak memory use before GGC: 18273k
    Peak memory use after GGC: 17952k
    Maximum of released memory in single GGC run: 3378k
    Garbage: 111389k -> 111389k
    Leak: 7038k
    Overhead: 13723k
    GGC runs: 502

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 80948k
    Peak memory use before GGC: 69508k
    Peak memory use after GGC: 45044k
    Maximum of released memory in single GGC run: 36220k
    Garbage: 146427k
    Leak: 10131k
    Overhead: 19750k
    GGC runs: 247

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 109560k
    Peak memory use before GGC: 91973k
    Peak memory use after GGC: 81071k
    Maximum of released memory in single GGC run: 32143k
    Garbage: 296462k
    Leak: 10054k
    Overhead: 36102k
    GGC runs: 245

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 122560k
    Peak memory use before GGC: 109356k
    Peak memory use after GGC: 80974k
    Maximum of released memory in single GGC run: 31578k
    Garbage: 381018k
    Leak: 10156k
    Overhead: 47871k
    GGC runs: 274

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 122616k
    Peak memory use before GGC: 109382k
    Peak memory use after GGC: 80999k
    Maximum of released memory in single GGC run: 31908k
    Garbage: 381619k
    Leak: 10160k
    Overhead: 48068k
    GGC runs: 276

comparing Gerald's testcase PR8361 compilation at -O0 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 95027k to 95198k, overall 0.18%
  Peak amount of GGC memory still allocated after garbage collectin increased from 94080k to 94250k, overall 0.18%
  Amount of produced GGC garbage increased from 223448k to 223714k, overall 0.12%
    Overall memory needed: 118252k -> 118424k
    Peak memory use before GGC: 95027k -> 95198k
    Peak memory use after GGC: 94080k -> 94250k
    Maximum of released memory in single GGC run: 20299k -> 20356k
    Garbage: 223448k -> 223714k
    Leak: 49470k -> 49472k
    Overhead: 37085k -> 37113k
    GGC runs: 369

comparing Gerald's testcase PR8361 compilation at -O1 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 95143k to 95331k, overall 0.20%
  Peak amount of GGC memory still allocated after garbage collectin increased from 93151k to 93251k, overall 0.11%
  Amount of produced GGC garbage increased from 563996k to 565076k, overall 0.19%
    Overall memory needed: 108460k -> 108528k
    Peak memory use before GGC: 95143k -> 95331k
    Peak memory use after GGC: 93151k -> 93251k
    Maximum of released memory in single GGC run: 20158k -> 20233k
    Garbage: 563996k -> 565076k
    Leak: 52248k -> 52291k
    Overhead: 63607k -> 63655k
    GGC runs: 532 -> 531

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting increased from 95143k to 95331k, overall 0.20%
  Peak amount of GGC memory still allocated after garbage collectin increased from 93152k to 93252k, overall 0.11%
    Overall memory needed: 108564k -> 108532k
    Peak memory use before GGC: 95143k -> 95331k
    Peak memory use after GGC: 93152k -> 93252k
    Maximum of released memory in single GGC run: 20158k -> 20232k
    Garbage: 655320k -> 655144k
    Leak: 53066k -> 53114k
    Overhead: 75063k -> 74999k
    GGC runs: 597 -> 594

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Overall memory allocated via mmap and sbrk increased from 110792k to 114216k, overall 3.09%
  Peak amount of GGC memory allocated before garbage collecting increased from 96537k to 96797k, overall 0.27%
  Amount of produced GGC garbage increased from 713949k to 715025k, overall 0.15%
    Overall memory needed: 110792k -> 114216k
    Peak memory use before GGC: 96537k -> 96797k
    Peak memory use after GGC: 94579k -> 94327k
    Maximum of released memory in single GGC run: 20582k -> 20729k
    Garbage: 713949k -> 715025k
    Leak: 53955k -> 53992k
    Overhead: 79319k -> 79548k
    GGC runs: 609 -> 606

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-02-03 14:49:19.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-02-04 01:11:28.000000000 +0000
@@ -1,10 +1,31 @@
+2006-02-03  Jason Merrill  <jason@redhat.com>
+
+	PR c++/25979
+	* gimplify.c (gimplify_modify_expr_rhs): Disable *& optimization for now.
+
+	PR middle-end/25977
+	* gimplify.c (gimplify_modify_expr_rhs): It's not always safe to do RVO
+	on the return slot if it's an NRV.
+
+2006-02-03  Zdenek Dvorak <dvorakz@suse.cz>
+
+	* tree-ssa-loop-ivopts.c (enum use_type): Remove USE_OUTER.
+	(dump_use, add_derived_ivs_candidates, determine_use_iv_cost,
+	rewrite_use): Do not handle USE_OUTER.
+	(find_interesting_uses_outer_or_nonlin, find_interesting_uses_outer,
+	add_iv_outer_candidates, may_replace_final_value,
+	determine_use_iv_cost_outer, rewrite_use_outer): Removed.
+	(find_interesting_uses_op): Functionality of
+	find_interesting_uses_outer_or_nonlin moved here.
+	(find_interesting_uses_outside): Use find_interesting_uses_op.
+
 2006-02-03  Alan Modra  <amodra@bigpond.net.au>
 
 	PR target/25960
 	* config/rs6000/darwin-ldouble.c (__gcc_qadd): Preserve -0.0 result.
 
 2006-02-03  Andreas Krebbel  <krebbel1@de.ibm.com>
-            Ulrich Weigand  <uweigand@de.ibm.com>
+	    Ulrich Weigand  <uweigand@de.ibm.com>
 
 	PR target/25864
 	* config/s390/2084.md ("x_fsimptf", "x_fmultf", "x_fdivtf",
--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog.cp	2006-02-01 10:57:54.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/cp/ChangeLog	2006-02-04 01:11:28.000000000 +0000
@@ -1,3 +1,36 @@
+2006-02-03  Lee Millward  <lee.millward@gmail.com>
+
+       * typeck.c (string_conv_p): Pass appropiate
+       OPT_Wxxxx values when calling warning().
+       (build_array_ref, cxx_mark_addressable): Likewise.
+       (check_return_expr): Likewise.
+
+       * init.c (perform_member_init): Likewise.
+       (sort_mem_initializers, emit_mem_initializers): Likewise.
+
+       * class.c (check_field_decls): Likewise.
+       (warn_about_ambiguous_bases): Likewise.
+
+       * decl.c (pop_label, poplevel): Likewise.
+       (duplicate_decls, grok_op_properties): Likewise.
+       (start_preparsed_function, finish_function): Likewise.
+
+       * name-lookup.c (pushdecl_maybe_friend): Likewise.
+       (pushdecl_maybe_friend): Likewise.
+
+       * parser.c (cp_parser_warn_min_max): Likewise.
+       (cp_parser_cast_expression): Likewise.
+
+       * method.c (lazily_declare_fn): Likewise.
+       * cvt.c (convert_to_void): Likewise.
+       * mangle.c (finish_mangling): Likewise.
+       * cp-gimplify.c (gimplify_expr_stmt): Likewise.
+
+2006-02-03  Mark Mitchell  <mark@codesourcery.com>
+
+	* name-lookup.c (do_class_using_decl): Use IDENTIFIER_TYPENAME_P,
+	not IDENTIFIER_OPNAME_P.
+
 2006-01-31  Mark Mitchell  <mark@codesourcery.com>
 
 	PR c++/25342
@@ -281,7 +314,7 @@
 	(cp_parser_asm_definition): Call cgraph_add_asm_node rather than
 	assemble_asm.
 
-2006-01-16  Rafael ?vila de Esp?ndola  <rafael.espindola@gmail.com>
+2006-01-16  Rafael ???ila de Esp???dola  <rafael.espindola@gmail.com>
 
 	* g++spec.c (lang_specific_spec_functions): Remove.
 
@@ -553,7 +586,7 @@
 	* mangle.c (write_bare_function_type): Mangle return type for
 	methods of Java classes
 
-2005-12-08  Th?odore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+2005-12-08  Th???dore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
 
 	* call.c (build_conditional_expr): Print types in error messages.
 
@@ -565,11 +598,11 @@
 
 	* cp-gimplify.c (gimplify_cp_loop): Use fold_build3.
 
-2005-12-07  Rafael ?vila de Esp?ndola  <rafael.espindola@gmail.com>
+2005-12-07  Rafael ???ila de Esp???dola  <rafael.espindola@gmail.com>
 
 	* Make-lang.in (c++.all.build, c++.install-normal): Remove.
 
-2005-12-07  Rafael ?vila de Esp?ndola  <rafael.espindola@gmail.com>
+2005-12-07  Rafael ???ila de Esp???dola  <rafael.espindola@gmail.com>
 
 	* Make-lang.in: Remove all dependencies on s-gtype.
 


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]