Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: src/heap.cc

Issue 15114003: Simplifying GC heuristics, deleted old generation limit factor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 remembered_unmapped_pages_index_(0), 113 remembered_unmapped_pages_index_(0),
114 unflattened_strings_length_(0), 114 unflattened_strings_length_(0),
115 #ifdef DEBUG 115 #ifdef DEBUG
116 allocation_allowed_(true), 116 allocation_allowed_(true),
117 allocation_timeout_(0), 117 allocation_timeout_(0),
118 disallow_allocation_failure_(false), 118 disallow_allocation_failure_(false),
119 #endif // DEBUG 119 #endif // DEBUG
120 new_space_high_promotion_mode_active_(false), 120 new_space_high_promotion_mode_active_(false),
121 old_gen_promotion_limit_(kMinimumPromotionLimit), 121 old_gen_promotion_limit_(kMinimumPromotionLimit),
122 old_gen_allocation_limit_(kMinimumAllocationLimit), 122 old_gen_allocation_limit_(kMinimumAllocationLimit),
123 old_gen_limit_factor_(1),
124 size_of_old_gen_at_last_old_space_gc_(0), 123 size_of_old_gen_at_last_old_space_gc_(0),
125 external_allocation_limit_(0), 124 external_allocation_limit_(0),
126 amount_of_external_allocated_memory_(0), 125 amount_of_external_allocated_memory_(0),
127 amount_of_external_allocated_memory_at_last_global_gc_(0), 126 amount_of_external_allocated_memory_at_last_global_gc_(0),
128 old_gen_exhausted_(false), 127 old_gen_exhausted_(false),
129 store_buffer_rebuilder_(store_buffer()), 128 store_buffer_rebuilder_(store_buffer()),
130 hidden_string_(NULL), 129 hidden_string_(NULL),
131 global_gc_prologue_callback_(NULL), 130 global_gc_prologue_callback_(NULL),
132 global_gc_epilogue_callback_(NULL), 131 global_gc_epilogue_callback_(NULL),
133 gc_safe_size_of_old_object_(NULL), 132 gc_safe_size_of_old_object_(NULL),
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 // We speed up the incremental marker if it is running so that it 904 // We speed up the incremental marker if it is running so that it
906 // does not fall behind the rate of promotion, which would cause a 905 // does not fall behind the rate of promotion, which would cause a
907 // constantly growing old space. 906 // constantly growing old space.
908 incremental_marking()->NotifyOfHighPromotionRate(); 907 incremental_marking()->NotifyOfHighPromotionRate();
909 } 908 }
910 909
911 if (collector == MARK_COMPACTOR) { 910 if (collector == MARK_COMPACTOR) {
912 // Perform mark-sweep with optional compaction. 911 // Perform mark-sweep with optional compaction.
913 MarkCompact(tracer); 912 MarkCompact(tracer);
914 sweep_generation_++; 913 sweep_generation_++;
915 bool high_survival_rate_during_scavenges = IsHighSurvivalRate() &&
916 IsStableOrIncreasingSurvivalTrend();
917 914
918 UpdateSurvivalRateTrend(start_new_space_size); 915 UpdateSurvivalRateTrend(start_new_space_size);
919 916
920 size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects(); 917 size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects();
921 918
922 if (high_survival_rate_during_scavenges &&
923 IsStableOrIncreasingSurvivalTrend()) {
924 // Stable high survival rates of young objects both during partial and
925 // full collection indicate that mutator is either building or modifying
926 // a structure with a long lifetime.
927 // In this case we aggressively raise old generation memory limits to
928 // postpone subsequent mark-sweep collection and thus trade memory
929 // space for the mutation speed.
930 old_gen_limit_factor_ = 2;
931 } else {
932 old_gen_limit_factor_ = 1;
933 }
934
935 old_gen_promotion_limit_ = 919 old_gen_promotion_limit_ =
936 OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_); 920 OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_);
937 old_gen_allocation_limit_ = 921 old_gen_allocation_limit_ =
938 OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_); 922 OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_);
939 923
940 old_gen_exhausted_ = false; 924 old_gen_exhausted_ = false;
941 } else { 925 } else {
942 tracer_ = tracer; 926 tracer_ = tracer;
943 Scavenge(); 927 Scavenge();
944 tracer_ = NULL; 928 tracer_ = NULL;
(...skipping 4943 matching lines...) Expand 10 before | Expand all | Expand 10 after
5888 // populated (via a call to CollectStatistics or else as a side effect of a 5872 // populated (via a call to CollectStatistics or else as a side effect of a
5889 // just-completed scavenge collection). 5873 // just-completed scavenge collection).
5890 void Heap::ReportHeapStatistics(const char* title) { 5874 void Heap::ReportHeapStatistics(const char* title) {
5891 USE(title); 5875 USE(title);
5892 PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n", 5876 PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n",
5893 title, gc_count_); 5877 title, gc_count_);
5894 PrintF("old_gen_promotion_limit_ %" V8_PTR_PREFIX "d\n", 5878 PrintF("old_gen_promotion_limit_ %" V8_PTR_PREFIX "d\n",
5895 old_gen_promotion_limit_); 5879 old_gen_promotion_limit_);
5896 PrintF("old_gen_allocation_limit_ %" V8_PTR_PREFIX "d\n", 5880 PrintF("old_gen_allocation_limit_ %" V8_PTR_PREFIX "d\n",
5897 old_gen_allocation_limit_); 5881 old_gen_allocation_limit_);
5898 PrintF("old_gen_limit_factor_ %d\n", old_gen_limit_factor_);
5899 5882
5900 PrintF("\n"); 5883 PrintF("\n");
5901 PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles(isolate_)); 5884 PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles(isolate_));
5902 isolate_->global_handles()->PrintStats(); 5885 isolate_->global_handles()->PrintStats();
5903 PrintF("\n"); 5886 PrintF("\n");
5904 5887
5905 PrintF("Heap statistics : "); 5888 PrintF("Heap statistics : ");
5906 isolate_->memory_allocator()->ReportStatistics(); 5889 isolate_->memory_allocator()->ReportStatistics();
5907 PrintF("To space : "); 5890 PrintF("To space : ");
5908 new_space_.ReportStatistics(); 5891 new_space_.ReportStatistics();
(...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after
7876 if (FLAG_parallel_recompilation) { 7859 if (FLAG_parallel_recompilation) {
7877 heap_->relocation_mutex_->Lock(); 7860 heap_->relocation_mutex_->Lock();
7878 #ifdef DEBUG 7861 #ifdef DEBUG
7879 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7862 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7880 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7863 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7881 #endif // DEBUG 7864 #endif // DEBUG
7882 } 7865 }
7883 } 7866 }
7884 7867
7885 } } // namespace v8::internal 7868 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698