diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index adb4a8a72f2..de0a0927115 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -2956,7 +2956,7 @@ void G1CollectedHeap::abandon_collection_set() { collection_set()->abandon(); } -size_t G1CollectedHeap::non_young_occupancy_after_allocation(size_t allocation_word_size) { +size_t G1CollectedHeap::non_young_occupancy_after_allocation(size_t allocation_word_size) const { const size_t cur_occupancy = (old_regions_count() + humongous_regions_count()) * G1HeapRegion::GrainBytes - _allocator->free_bytes_in_retained_old_region(); // Humongous allocations will always be assigned to non-young heap, so consider diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp index 3a47453819e..a68d1030636 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp @@ -1032,7 +1032,7 @@ public: // Returns how much memory there is assigned to non-young heap that can not be // allocated into any more without garbage collection after a hypothetical // allocation of allocation_word_size. - size_t non_young_occupancy_after_allocation(size_t allocation_word_size); + size_t non_young_occupancy_after_allocation(size_t allocation_word_size) const; // Determine whether the given region is one that we are using as an // old GC alloc region. diff --git a/src/hotspot/share/gc/g1/g1IHOPControl.cpp b/src/hotspot/share/gc/g1/g1IHOPControl.cpp index 1e1c52477f9..164486123f7 100644 --- a/src/hotspot/share/gc/g1/g1IHOPControl.cpp +++ b/src/hotspot/share/gc/g1/g1IHOPControl.cpp @@ -114,7 +114,7 @@ void G1IHOPControl::add_marking_start_to_mixed_length(double length_s) { // Determine the old generation occupancy threshold at which to start // concurrent marking such that reclamation (first Mixed GC) begins // before the heap reaches a critical occupancy level. -size_t G1IHOPControl::old_gen_threshold_for_conc_mark_start() { +size_t G1IHOPControl::old_gen_threshold_for_conc_mark_start() const { guarantee(_target_occupancy > 0, "Target occupancy must be initialized"); if (!_is_adaptive || !have_enough_data_for_prediction()) { diff --git a/src/hotspot/share/gc/g1/g1IHOPControl.hpp b/src/hotspot/share/gc/g1/g1IHOPControl.hpp index ff209012f02..2836408978b 100644 --- a/src/hotspot/share/gc/g1/g1IHOPControl.hpp +++ b/src/hotspot/share/gc/g1/g1IHOPControl.hpp @@ -115,7 +115,7 @@ class G1IHOPControl : public CHeapObj { void add_marking_start_to_mixed_length(double length_s); // Get the current non-young occupancy at which concurrent marking should start. - size_t old_gen_threshold_for_conc_mark_start(); + size_t old_gen_threshold_for_conc_mark_start() const; void report_statistics(G1NewTracer* tracer, size_t non_young_occupancy); }; diff --git a/src/hotspot/share/gc/g1/g1Policy.cpp b/src/hotspot/share/gc/g1/g1Policy.cpp index 78a533d62c0..769977c7dac 100644 --- a/src/hotspot/share/gc/g1/g1Policy.cpp +++ b/src/hotspot/share/gc/g1/g1Policy.cpp @@ -728,7 +728,7 @@ bool G1Policy::about_to_start_mixed_phase() const { return collector_state()->is_in_concurrent_cycle() || collector_state()->is_in_prepare_mixed_gc(); } -bool G1Policy::need_to_start_conc_mark(const char* source, size_t allocation_word_size) { +bool G1Policy::need_to_start_conc_mark(const char* source, size_t allocation_word_size) const { if (about_to_start_mixed_phase()) { return false; } diff --git a/src/hotspot/share/gc/g1/g1Policy.hpp b/src/hotspot/share/gc/g1/g1Policy.hpp index 5c5c2bc3572..0aa15be9cae 100644 --- a/src/hotspot/share/gc/g1/g1Policy.hpp +++ b/src/hotspot/share/gc/g1/g1Policy.hpp @@ -296,7 +296,7 @@ public: void record_young_gc_pause_start(); void record_young_gc_pause_end(bool evacuation_failed); - bool need_to_start_conc_mark(const char* source, size_t allocation_word_size); + bool need_to_start_conc_mark(const char* source, size_t allocation_word_size) const; bool concurrent_operation_is_full_mark(const char* msg, size_t allocation_word_size);