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 decreased 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: 24797k
    Peak memory use before GGC: 8930k
    Peak memory use after GGC: 8558k
    Maximum of released memory in single GGC run: 2576k
    Garbage: 34882k
    Leak: 6058k
    Overhead: 4715k
    GGC runs: 294

comparing combine.c compilation at -O1 level:
  Amount of produced GGC garbage decreased from 54850k to 53159k, overall -3.18%
    Overall memory needed: 36213k -> 36197k
    Peak memory use before GGC: 17003k -> 17001k
    Peak memory use after GGC: 16831k
    Maximum of released memory in single GGC run: 2264k -> 2262k
    Garbage: 54850k -> 53159k
    Leak: 6079k -> 6064k
    Overhead: 5766k -> 5766k
    GGC runs: 375 -> 369

comparing combine.c compilation at -O2 level:
  Amount of produced GGC garbage decreased from 78525k to 71411k, overall -9.96%
    Overall memory needed: 26500k
    Peak memory use before GGC: 17000k -> 16999k
    Peak memory use after GGC: 16831k
    Maximum of released memory in single GGC run: 2539k -> 2538k
    Garbage: 78525k -> 71411k
    Leak: 6181k -> 6174k
    Overhead: 8299k -> 8298k
    GGC runs: 439 -> 432

comparing combine.c compilation at -O3 level:
  Amount of produced GGC garbage decreased from 107493k to 98042k, overall -9.64%
    Overall memory needed: 25596k
    Peak memory use before GGC: 18135k -> 17891k
    Peak memory use after GGC: 17449k -> 17447k
    Maximum of released memory in single GGC run: 3325k -> 3316k
    Garbage: 107493k -> 98042k
    Leak: 6250k -> 6241k
    Overhead: 11479k -> 11480k
    GGC runs: 487 -> 480

comparing insn-attrtab.c compilation at -O0 level:
    Overall memory needed: 83700k
    Peak memory use before GGC: 68249k
    Peak memory use after GGC: 43914k
    Maximum of released memory in single GGC run: 35709k
    Garbage: 126210k
    Leak: 8878k
    Overhead: 16830k
    GGC runs: 230

comparing insn-attrtab.c compilation at -O1 level:
    Overall memory needed: 103088k -> 103080k
    Peak memory use before GGC: 83524k -> 83522k
    Peak memory use after GGC: 77617k -> 77615k
    Maximum of released memory in single GGC run: 31805k
    Garbage: 259508k -> 258199k
    Leak: 8930k -> 8928k
    Overhead: 28448k -> 28448k
    GGC runs: 232 -> 230

comparing insn-attrtab.c compilation at -O2 level:
    Overall memory needed: 105356k -> 105360k
    Peak memory use before GGC: 87821k -> 87454k
    Peak memory use after GGC: 79916k -> 79914k
    Maximum of released memory in single GGC run: 30384k
    Garbage: 306011k -> 303596k
    Leak: 8935k -> 8933k
    Overhead: 35480k -> 35482k
    GGC runs: 257 -> 256

comparing insn-attrtab.c compilation at -O3 level:
    Overall memory needed: 105392k
    Peak memory use before GGC: 87847k -> 87481k
    Peak memory use after GGC: 79943k -> 79941k
    Maximum of released memory in single GGC run: 30571k -> 30565k
    Garbage: 306601k -> 304166k
    Leak: 8938k -> 8936k
    Overhead: 35657k -> 35660k
    GGC runs: 261 -> 260

comparing Gerald's testcase PR8361 compilation at -O0 level:
    Overall memory needed: 116264k
    Peak memory use before GGC: 92429k
    Peak memory use after GGC: 91509k
    Maximum of released memory in single GGC run: 19647k
    Garbage: 199228k
    Leak: 47210k
    Overhead: 20339k
    GGC runs: 398

comparing Gerald's testcase PR8361 compilation at -O1 level:
    Overall memory needed: 115256k
    Peak memory use before GGC: 97004k
    Peak memory use after GGC: 94813k
    Maximum of released memory in single GGC run: 18292k
    Garbage: 434886k -> 427825k
    Leak: 49019k -> 48982k
    Overhead: 31294k -> 31293k
    GGC runs: 546 -> 537

comparing Gerald's testcase PR8361 compilation at -O2 level:
  Amount of produced GGC garbage decreased from 522797k to 493929k, overall -5.84%
    Overall memory needed: 115244k
    Peak memory use before GGC: 97005k
    Peak memory use after GGC: 94813k
    Maximum of released memory in single GGC run: 18292k
    Garbage: 522797k -> 493929k
    Leak: 49739k -> 49694k
    Overhead: 39442k -> 39440k
    GGC runs: 625 -> 606

comparing Gerald's testcase PR8361 compilation at -O3 level:
  Amount of produced GGC garbage decreased from 541462k to 512926k, overall -5.56%
    Overall memory needed: 116644k
    Peak memory use before GGC: 98438k
    Peak memory use after GGC: 96090k
    Maximum of released memory in single GGC run: 18613k
    Garbage: 541462k -> 512926k
    Leak: 49723k -> 49679k
    Overhead: 40200k -> 40205k
    GGC runs: 638 -> 613

comparing PR rtl-optimization/28071 testcase compilation at -O0 level:
    Overall memory needed: 134136k
    Peak memory use before GGC: 81627k
    Peak memory use after GGC: 58507k
    Maximum of released memory in single GGC run: 45492k
    Garbage: 143522k
    Leak: 7142k
    Overhead: 25103k
    GGC runs: 87

comparing PR rtl-optimization/28071 testcase compilation at -O1 level:
    Overall memory needed: 432592k -> 425400k
    Peak memory use before GGC: 203917k -> 203152k
    Peak memory use after GGC: 199695k -> 198930k
    Maximum of released memory in single GGC run: 100795k -> 100798k
    Garbage: 272002k -> 264973k
    Leak: 47195k -> 47195k
    Overhead: 30026k -> 30026k
    GGC runs: 106

comparing PR rtl-optimization/28071 testcase compilation at -O2 level:
  Peak amount of GGC memory allocated before garbage collecting run decreased from 213376k to 203907k, overall -4.64%
  Amount of produced GGC garbage decreased from 387716k to 354483k, overall -9.38%
    Overall memory needed: 355104k -> 347924k
    Peak memory use before GGC: 213376k -> 203907k
    Peak memory use after GGC: 200446k -> 199684k
    Maximum of released memory in single GGC run: 107072k
    Garbage: 387716k -> 354483k
    Leak: 47779k -> 47778k
    Overhead: 47627k -> 47627k
    GGC runs: 113

comparing PR rtl-optimization/28071 testcase compilation at -O3 -fno-tree-pre -fno-tree-fre level:
    Overall memory needed: 536116k -> 536244k
    Peak memory use before GGC: 314603k
    Peak memory use after GGC: 292947k
    Maximum of released memory in single GGC run: 163427k
    Garbage: 487439k
    Leak: 65111k
    Overhead: 58883k
    GGC runs: 100

Head of the ChangeLog is:

--- /usr/src/SpecTests/sandbox-britten-memory/x86_64/mem-result/ChangeLog	2006-09-11 23:27:58.000000000 +0000
+++ /usr/src/SpecTests/sandbox-britten-memory/gcc/gcc/ChangeLog	2006-09-12 10:53:48.000000000 +0000
@@ -1,3 +1,86 @@
+2006-09-12  Jan Hubicka  <jh@suse.cz>
+
+	PR rtl-optimization/28071
+	* tree-vect-transform.c (vect_create_data_ref_ptr): Kill cast.
+	(vect_transform_loop): Likewise.
+	* tree-vectorizer.c (new_loop_vec_info): Likewise.
+	(new_loop_vec_info): Likewise.
+	(destroy_loop_vec_info): Likewise.
+	* tree-dfa.c (create_var_ann): Use GCC_CNEW.
+	(create_stmt_ann): Likewise.
+	(create_tree_ann): Rename to ...
+	(create_tree_common_ann): ... this one; allocate only the common part
+	of annotations.
+	* tree-vn.c (set_value_handle): Use get_tree_common_ann.
+	(get_value_handle): Likewise.
+	* tree-ssa-pre.c (phi_translate): Delay annotation allocation for
+	get_tree_common_ann.
+	* tree-vectorizer.h (set_stmt_info): Take stmt annotation.
+	(vinfo_for_stmt): Use stmt annotations.
+	* tree-flow.h (tree_ann_common_t): New type.
+	(tree_common_ann, get_tree_common_ann, create_tree_common_ann): New.
+	(tree_ann, get_tree_ann, create_tree_ann): New.
+	* tree-flow-inline.h (get_function_ann): Do more type checking.
+	(stmt_ann): Likewise.
+	(tree_ann): Rename to ...
+	(tree_common_ann): ... this one; return ony common_ann
+	(get_tree_ann): Rename to ...
+	(tree_common_ann): This one; return only common_ann.
+	* tree-vect-patterns.c (vect_pattern_recog_1): Update call
+	of set_stmt_info.
+
+2006-09-11  Geoffrey Keating  <geoffk@apple.com>
+
+	* config.gcc (i[34567]86-*-darwin*): Set with_arch and
+	with_cpu by default.
+
+	* dwarf2out.c (dwarf_file_data): New.
+	(enum dw_val_class): Add dw_val_class_file.
+	(struct dw_val_struct): Add val_file.
+	(file_table): Change to a hash table.
+	(file_table_emitted): Delete.
+	(file_table_last_lookup_index): Delete.
+	(emitcount): Delete.
+	(last_emitted_file): New.
+	(lookup_filename): Change prototype to return a struct dwarf_file_data.
+	(init_file_table): Delete.
+	(maybe_emit_file): Change prototype to take a struct dwarf_file_data.
+	(AT_addr): Add comment.
+	(add_AT_file): New.
+	(AT_file): New.
+	(get_AT_file): New.
+	(print_die): Handle dw_val_class_file.
+	(print_dwarf_line_table): Update for new file table structure.
+	(attr_checksum): Do checksum a filename.
+	(same_dw_val_p, same_attr_p): Do compare a filename.
+	(size_of_die): Handle dw_val_class_file.
+	(value_format): Likewise.
+	(output_die): Likewise.  Also, call maybe_emit_file here.
+	(struct file_info): Constify filenames.  Make file_idx a pointer
+	to a struct dwarf_file_data.
+	(struct dir_info): Constify directory names.  Remove 'used' field.
+	(struct file_name_acquire_data): New.
+	(file_name_acquire): New.
+	(output_file_names): Modify to handle new file data structures.
+	(add_src_coords_attributes): Use add_AT_file.
+	(add_call_src_coords_attributes): Likewise.
+	(dwarf2out_imported_module_or_decl): Likewise.
+	(gen_subprogram_die): Modify for new file data structures.
+	(gen_variable_die): Likewise.
+	(file_table_eq): New.
+	(file_table_hash): New.
+	(file_table_last_lookup): New.
+	(lookup_filename): Rewrite to handle new file data structures.
+	(maybe_emit_file): Rewrite to handle new file data structures.
+	(dwarf2out_source_line): Always call lookup_filename and
+	maybe_emit_file.
+	(dwarf2out_init): Create file_table here.
+	(prune_unused_types_walk_attribs): Don't call maybe_emit_file here.
+	(file_table_relative_p): New.
+	(dwarf2out_finish): Change detection of relative filenames
+	to work with new file data structures.  Move output_line_info call
+	after debug_info output.
+
 2006-09-11  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR target/13685


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]