8276670: G1: Rename G1CardSetFreePool and related classes

Reviewed-by: tschatzl, ayang
This commit is contained in:
Hamlin Li 2021-11-27 00:46:09 +00:00
parent b9eb532de2
commit e9b36a8316
15 changed files with 154 additions and 136 deletions

View File

@ -30,7 +30,6 @@
#include "runtime/atomic.hpp" #include "runtime/atomic.hpp"
#include "utilities/ostream.hpp" #include "utilities/ostream.hpp"
template <class Elem> template <class Elem>
G1CardSetAllocator<Elem>::G1CardSetAllocator(const char* name, G1CardSetAllocator<Elem>::G1CardSetAllocator(const char* name,
const G1CardSetAllocOptions* buffer_options, const G1CardSetAllocOptions* buffer_options,
@ -202,11 +201,11 @@ size_t G1CardSetMemoryManager::wasted_mem_size() const {
return result; return result;
} }
G1CardSetMemoryStats G1CardSetMemoryManager::memory_stats() const { G1SegmentedArrayMemoryStats G1CardSetMemoryManager::memory_stats() const {
G1CardSetMemoryStats result; G1SegmentedArrayMemoryStats result;
for (uint i = 0; i < num_mem_object_types(); i++) { for (uint i = 0; i < num_mem_object_types(); i++) {
result._num_mem_sizes[i] += _allocators[i].mem_size(); result._num_mem_sizes[i] += _allocators[i].mem_size();
result._num_buffers[i] += _allocators[i].num_buffers(); result._num_segments[i] += _allocators[i].num_buffers();
} }
return result; return result;
} }

View File

@ -136,6 +136,8 @@ public:
void print(outputStream* os); void print(outputStream* os);
}; };
typedef G1SegmentedArrayFreePool<mtGCCardSet> G1CardSetFreePool;
class G1CardSetMemoryManager : public CHeapObj<mtGCCardSet> { class G1CardSetMemoryManager : public CHeapObj<mtGCCardSet> {
G1CardSetConfiguration* _config; G1CardSetConfiguration* _config;
@ -163,7 +165,7 @@ public:
size_t mem_size() const; size_t mem_size() const;
size_t wasted_mem_size() const; size_t wasted_mem_size() const;
G1CardSetMemoryStats memory_stats() const; G1SegmentedArrayMemoryStats memory_stats() const;
}; };
#endif // SHARE_GC_G1_G1CARDSETMEMORY_HPP #endif // SHARE_GC_G1_G1CARDSETMEMORY_HPP

View File

@ -33,7 +33,6 @@
#include "gc/g1/g1Arguments.hpp" #include "gc/g1/g1Arguments.hpp"
#include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BatchedTask.hpp" #include "gc/g1/g1BatchedTask.hpp"
#include "gc/g1/g1CardSetFreeMemoryTask.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectionSet.hpp" #include "gc/g1/g1CollectionSet.hpp"
#include "gc/g1/g1CollectionSetCandidates.hpp" #include "gc/g1/g1CollectionSetCandidates.hpp"
@ -65,13 +64,14 @@
#include "gc/g1/g1RootClosures.hpp" #include "gc/g1/g1RootClosures.hpp"
#include "gc/g1/g1RootProcessor.hpp" #include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/g1SATBMarkQueueSet.hpp" #include "gc/g1/g1SATBMarkQueueSet.hpp"
#include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp"
#include "gc/g1/g1ServiceThread.hpp"
#include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/g1Trace.hpp" #include "gc/g1/g1Trace.hpp"
#include "gc/g1/g1ServiceThread.hpp"
#include "gc/g1/g1UncommitRegionTask.hpp" #include "gc/g1/g1UncommitRegionTask.hpp"
#include "gc/g1/g1VMOperations.hpp" #include "gc/g1/g1VMOperations.hpp"
#include "gc/g1/g1YoungGCEvacFailureInjector.hpp"
#include "gc/g1/g1YoungCollector.hpp" #include "gc/g1/g1YoungCollector.hpp"
#include "gc/g1/g1YoungGCEvacFailureInjector.hpp"
#include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegion.inline.hpp"
#include "gc/g1/heapRegionRemSet.inline.hpp" #include "gc/g1/heapRegionRemSet.inline.hpp"
#include "gc/g1/heapRegionSet.inline.hpp" #include "gc/g1/heapRegionSet.inline.hpp"
@ -87,17 +87,17 @@
#include "gc/shared/locationPrinter.inline.hpp" #include "gc/shared/locationPrinter.inline.hpp"
#include "gc/shared/oopStorageParState.hpp" #include "gc/shared/oopStorageParState.hpp"
#include "gc/shared/preservedMarks.inline.hpp" #include "gc/shared/preservedMarks.inline.hpp"
#include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/shared/referenceProcessor.inline.hpp" #include "gc/shared/referenceProcessor.inline.hpp"
#include "gc/shared/taskTerminator.hpp" #include "gc/shared/suspendibleThreadSet.hpp"
#include "gc/shared/taskqueue.inline.hpp" #include "gc/shared/taskqueue.inline.hpp"
#include "gc/shared/taskTerminator.hpp"
#include "gc/shared/tlab_globals.hpp" #include "gc/shared/tlab_globals.hpp"
#include "gc/shared/weakProcessor.inline.hpp"
#include "gc/shared/workerPolicy.hpp" #include "gc/shared/workerPolicy.hpp"
#include "gc/shared/weakProcessor.inline.hpp"
#include "logging/log.hpp" #include "logging/log.hpp"
#include "memory/allocation.hpp" #include "memory/allocation.hpp"
#include "memory/iterator.hpp"
#include "memory/heapInspection.hpp" #include "memory/heapInspection.hpp"
#include "memory/iterator.hpp"
#include "memory/metaspaceUtils.hpp" #include "memory/metaspaceUtils.hpp"
#include "memory/resourceArea.hpp" #include "memory/resourceArea.hpp"
#include "memory/universe.hpp" #include "memory/universe.hpp"
@ -1431,7 +1431,7 @@ G1CollectedHeap::G1CollectedHeap() :
CollectedHeap(), CollectedHeap(),
_service_thread(NULL), _service_thread(NULL),
_periodic_gc_task(NULL), _periodic_gc_task(NULL),
_free_card_set_memory_task(NULL), _free_segmented_array_memory_task(NULL),
_workers(NULL), _workers(NULL),
_card_table(NULL), _card_table(NULL),
_collection_pause_end(Ticks::now()), _collection_pause_end(Ticks::now()),
@ -1723,8 +1723,8 @@ jint G1CollectedHeap::initialize() {
_periodic_gc_task = new G1PeriodicGCTask("Periodic GC Task"); _periodic_gc_task = new G1PeriodicGCTask("Periodic GC Task");
_service_thread->register_task(_periodic_gc_task); _service_thread->register_task(_periodic_gc_task);
_free_card_set_memory_task = new G1CardSetFreeMemoryTask("Card Set Free Memory Task"); _free_segmented_array_memory_task = new G1SegmentedArrayFreeMemoryTask("Card Set Free Memory Task");
_service_thread->register_task(_free_card_set_memory_task); _service_thread->register_task(_free_segmented_array_memory_task);
{ {
G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set(); G1DirtyCardQueueSet& dcqs = G1BarrierSet::dirty_card_queue_set();
@ -2616,8 +2616,8 @@ void G1CollectedHeap::gc_epilogue(bool full) {
_collection_pause_end = Ticks::now(); _collection_pause_end = Ticks::now();
_free_card_set_memory_task->notify_new_stats(&_young_gen_card_set_stats, _free_segmented_array_memory_task->notify_new_stats(&_young_gen_card_set_stats,
&_collection_set_candidates_card_set_stats); &_collection_set_candidates_card_set_stats);
} }
uint G1CollectedHeap::uncommit_regions(uint region_limit) { uint G1CollectedHeap::uncommit_regions(uint region_limit) {
@ -2941,11 +2941,11 @@ bool G1CollectedHeap::should_sample_collection_set_candidates() const {
return candidates != NULL && candidates->num_remaining() > 0; return candidates != NULL && candidates->num_remaining() > 0;
} }
void G1CollectedHeap::set_collection_set_candidates_stats(G1CardSetMemoryStats& stats) { void G1CollectedHeap::set_collection_set_candidates_stats(G1SegmentedArrayMemoryStats& stats) {
_collection_set_candidates_card_set_stats = stats; _collection_set_candidates_card_set_stats = stats;
} }
void G1CollectedHeap::set_young_gen_card_set_stats(const G1CardSetMemoryStats& stats) { void G1CollectedHeap::set_young_gen_card_set_stats(const G1SegmentedArrayMemoryStats& stats) {
_young_gen_card_set_stats = stats; _young_gen_card_set_stats = stats;
} }

View File

@ -27,7 +27,6 @@
#include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1BiasedArray.hpp" #include "gc/g1/g1BiasedArray.hpp"
#include "gc/g1/g1CardSetFreeMemoryTask.hpp"
#include "gc/g1/g1CardTable.hpp" #include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1CollectionSet.hpp" #include "gc/g1/g1CollectionSet.hpp"
#include "gc/g1/g1CollectorState.hpp" #include "gc/g1/g1CollectorState.hpp"
@ -35,12 +34,13 @@
#include "gc/g1/g1EdenRegions.hpp" #include "gc/g1/g1EdenRegions.hpp"
#include "gc/g1/g1EvacStats.hpp" #include "gc/g1/g1EvacStats.hpp"
#include "gc/g1/g1GCPauseType.hpp" #include "gc/g1/g1GCPauseType.hpp"
#include "gc/g1/g1HeapRegionAttr.hpp"
#include "gc/g1/g1HeapTransition.hpp" #include "gc/g1/g1HeapTransition.hpp"
#include "gc/g1/g1HeapVerifier.hpp" #include "gc/g1/g1HeapVerifier.hpp"
#include "gc/g1/g1HRPrinter.hpp" #include "gc/g1/g1HRPrinter.hpp"
#include "gc/g1/g1HeapRegionAttr.hpp"
#include "gc/g1/g1MonitoringSupport.hpp" #include "gc/g1/g1MonitoringSupport.hpp"
#include "gc/g1/g1NUMA.hpp" #include "gc/g1/g1NUMA.hpp"
#include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp"
#include "gc/g1/g1SurvivorRegions.hpp" #include "gc/g1/g1SurvivorRegions.hpp"
#include "gc/g1/g1YoungGCEvacFailureInjector.hpp" #include "gc/g1/g1YoungGCEvacFailureInjector.hpp"
#include "gc/g1/heapRegionManager.hpp" #include "gc/g1/heapRegionManager.hpp"
@ -143,7 +143,7 @@ class G1CollectedHeap : public CollectedHeap {
private: private:
G1ServiceThread* _service_thread; G1ServiceThread* _service_thread;
G1ServiceTask* _periodic_gc_task; G1ServiceTask* _periodic_gc_task;
G1CardSetFreeMemoryTask* _free_card_set_memory_task; G1SegmentedArrayFreeMemoryTask* _free_segmented_array_memory_task;
WorkerThreads* _workers; WorkerThreads* _workers;
G1CardTable* _card_table; G1CardTable* _card_table;
@ -160,9 +160,9 @@ private:
HeapRegionSet _humongous_set; HeapRegionSet _humongous_set;
// Young gen memory statistics before GC. // Young gen memory statistics before GC.
G1CardSetMemoryStats _young_gen_card_set_stats; G1SegmentedArrayMemoryStats _young_gen_card_set_stats;
// Collection set candidates memory statistics after GC. // Collection set candidates memory statistics after GC.
G1CardSetMemoryStats _collection_set_candidates_card_set_stats; G1SegmentedArrayMemoryStats _collection_set_candidates_card_set_stats;
// The block offset table for the G1 heap. // The block offset table for the G1 heap.
G1BlockOffsetTable* _bot; G1BlockOffsetTable* _bot;
@ -259,8 +259,8 @@ public:
void set_humongous_stats(uint num_humongous_total, uint num_humongous_candidates); void set_humongous_stats(uint num_humongous_total, uint num_humongous_candidates);
bool should_sample_collection_set_candidates() const; bool should_sample_collection_set_candidates() const;
void set_collection_set_candidates_stats(G1CardSetMemoryStats& stats); void set_collection_set_candidates_stats(G1SegmentedArrayMemoryStats& stats);
void set_young_gen_card_set_stats(const G1CardSetMemoryStats& stats); void set_young_gen_card_set_stats(const G1SegmentedArrayMemoryStats& stats);
private: private:

View File

@ -23,22 +23,23 @@
*/ */
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/g1/g1CardSetFreeMemoryTask.hpp" #include "ci/ciUtilities.hpp"
#include "gc/g1/g1CardSetMemory.inline.hpp" #include "gc/g1/g1CardSetMemory.inline.hpp"
#include "gc/g1/g1CollectedHeap.hpp" #include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1SegmentedArrayFreeMemoryTask.hpp"
#include "gc/g1/g1_globals.hpp" #include "gc/g1/g1_globals.hpp"
#include "gc/g1/heapRegionRemSet.hpp"
#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/suspendibleThreadSet.hpp" #include "gc/shared/suspendibleThreadSet.hpp"
#include "heapRegionRemSet.hpp" #include "runtime/os.hpp"
#include "ci/ciUtilities.hpp"
constexpr const char* G1CardSetFreeMemoryTask::_state_names[]; constexpr const char* G1SegmentedArrayFreeMemoryTask::_state_names[];
const char* G1CardSetFreeMemoryTask::get_state_name(State value) const { const char* G1SegmentedArrayFreeMemoryTask::get_state_name(State value) const {
return _state_names[static_cast<std::underlying_type_t<State>>(value)]; return _state_names[static_cast<std::underlying_type_t<State>>(value)];
} }
bool G1CardSetFreeMemoryTask::deadline_exceeded(jlong deadline) { bool G1SegmentedArrayFreeMemoryTask::deadline_exceeded(jlong deadline) {
return os::elapsed_counter() >= deadline; return os::elapsed_counter() >= deadline;
} }
@ -47,31 +48,31 @@ static size_t keep_size(size_t free, size_t used, double percent) {
return MIN2(free, to_keep); return MIN2(free, to_keep);
} }
bool G1CardSetFreeMemoryTask::calculate_return_infos(jlong deadline) { bool G1SegmentedArrayFreeMemoryTask::calculate_return_infos(jlong deadline) {
// Ignore the deadline in this step as it is very short. // Ignore the deadline in this step as it is very short.
G1CardSetMemoryStats used = _total_used; G1SegmentedArrayMemoryStats used = _total_used;
G1CardSetMemoryStats free = G1CardSetFreePool::free_list_sizes(); G1SegmentedArrayMemoryStats free = G1SegmentedArrayFreePool<mtGCCardSet>::free_list_sizes();
_return_info = new G1ReturnMemoryProcessorSet(used.num_pools()); _return_info = new G1ReturnMemoryProcessorSet(used.num_pools());
for (uint i = 0; i < used.num_pools(); i++) { for (uint i = 0; i < used.num_pools(); i++) {
size_t return_to_vm_size = keep_size(free._num_mem_sizes[i], size_t return_to_vm_size = keep_size(free._num_mem_sizes[i],
used._num_mem_sizes[i], used._num_mem_sizes[i],
G1RemSetFreeMemoryKeepExcessRatio); G1RemSetFreeMemoryKeepExcessRatio);
log_trace(gc, task)("Card Set Free Memory: Type %s: Free: %zu (%zu) " log_trace(gc, task)("Segmented Array Free Memory: Type %s: Free: %zu (%zu) "
"Used: %zu Keep: %zu", "Used: %zu Keep: %zu",
G1CardSetConfiguration::mem_object_type_name_str(i), G1CardSetConfiguration::mem_object_type_name_str(i),
free._num_mem_sizes[i], free._num_buffers[i], free._num_mem_sizes[i], free._num_segments[i],
used._num_mem_sizes[i], return_to_vm_size); used._num_mem_sizes[i], return_to_vm_size);
_return_info->append(new G1ReturnMemoryProcessor(return_to_vm_size)); _return_info->append(new G1ReturnMemoryProcessor(return_to_vm_size));
} }
G1CardSetFreePool::update_unlink_processors(_return_info); G1SegmentedArrayFreePool<mtGCCardSet>::update_unlink_processors(_return_info);
return false; return false;
} }
bool G1CardSetFreeMemoryTask::return_memory_to_vm(jlong deadline) { bool G1SegmentedArrayFreeMemoryTask::return_memory_to_vm(jlong deadline) {
for (int i = 0; i < _return_info->length(); i++) { for (int i = 0; i < _return_info->length(); i++) {
G1ReturnMemoryProcessor* info = _return_info->at(i); G1ReturnMemoryProcessor* info = _return_info->at(i);
if (!info->finished_return_to_vm()) { if (!info->finished_return_to_vm()) {
@ -83,7 +84,7 @@ bool G1CardSetFreeMemoryTask::return_memory_to_vm(jlong deadline) {
return false; return false;
} }
bool G1CardSetFreeMemoryTask::return_memory_to_os(jlong deadline) { bool G1SegmentedArrayFreeMemoryTask::return_memory_to_os(jlong deadline) {
for (int i = 0; i < _return_info->length(); i++) { for (int i = 0; i < _return_info->length(); i++) {
G1ReturnMemoryProcessor* info = _return_info->at(i); G1ReturnMemoryProcessor* info = _return_info->at(i);
if (!info->finished_return_to_os()) { if (!info->finished_return_to_os()) {
@ -95,7 +96,7 @@ bool G1CardSetFreeMemoryTask::return_memory_to_os(jlong deadline) {
return false; return false;
} }
bool G1CardSetFreeMemoryTask::cleanup_return_infos() { bool G1SegmentedArrayFreeMemoryTask::cleanup_return_infos() {
for (int i = 0; i < _return_info->length(); i++) { for (int i = 0; i < _return_info->length(); i++) {
G1ReturnMemoryProcessor* info = _return_info->at(i); G1ReturnMemoryProcessor* info = _return_info->at(i);
delete info; delete info;
@ -106,12 +107,12 @@ bool G1CardSetFreeMemoryTask::cleanup_return_infos() {
return false; return false;
} }
bool G1CardSetFreeMemoryTask::free_excess_card_set_memory() { bool G1SegmentedArrayFreeMemoryTask::free_excess_segmented_array_memory() {
jlong start = os::elapsed_counter(); jlong start = os::elapsed_counter();
jlong end = start + jlong end = start +
(os::elapsed_frequency() / 1000) * G1RemSetFreeMemoryStepDurationMillis; (os::elapsed_frequency() / 1000) * G1RemSetFreeMemoryStepDurationMillis;
log_trace(gc, task)("Card Set Free Memory: Step start %1.3f end %1.3f", log_trace(gc, task)("Segmented Array Free Memory: Step start %1.3f end %1.3f",
TimeHelper::counter_to_millis(start), TimeHelper::counter_to_millis(end)); TimeHelper::counter_to_millis(start), TimeHelper::counter_to_millis(end));
State next_state; State next_state;
@ -148,7 +149,7 @@ bool G1CardSetFreeMemoryTask::free_excess_card_set_memory() {
break; break;
} }
default: default:
log_error(gc, task)("Should not try to free excess card set memory in %s state", get_state_name(_state)); log_error(gc, task)("Should not try to free excess segmented array memory in %s state", get_state_name(_state));
ShouldNotReachHere(); ShouldNotReachHere();
break; break;
} }
@ -156,41 +157,41 @@ bool G1CardSetFreeMemoryTask::free_excess_card_set_memory() {
set_state(next_state); set_state(next_state);
} while (_state != State::Inactive && !deadline_exceeded(end)); } while (_state != State::Inactive && !deadline_exceeded(end));
log_trace(gc, task)("Card Set Free Memory: Step took %1.3fms, done %s", log_trace(gc, task)("Segmented Array Free Memory: Step took %1.3fms, done %s",
TimeHelper::counter_to_millis(os::elapsed_counter() - start), TimeHelper::counter_to_millis(os::elapsed_counter() - start),
bool_to_str(_state == State::CalculateUsed)); bool_to_str(_state == State::CalculateUsed));
return is_active(); return is_active();
} }
void G1CardSetFreeMemoryTask::set_state(State new_state) { void G1SegmentedArrayFreeMemoryTask::set_state(State new_state) {
log_trace(gc, task)("Card Set Free Memory: State change from %s to %s", log_trace(gc, task)("Segmented Array Free Memory: State change from %s to %s",
get_state_name(_state), get_state_name(_state),
get_state_name(new_state)); get_state_name(new_state));
_state = new_state; _state = new_state;
} }
bool G1CardSetFreeMemoryTask::is_active() const { bool G1SegmentedArrayFreeMemoryTask::is_active() const {
return _state != State::Inactive; return _state != State::Inactive;
} }
jlong G1CardSetFreeMemoryTask::reschedule_delay_ms() const { jlong G1SegmentedArrayFreeMemoryTask::reschedule_delay_ms() const {
return G1RemSetFreeMemoryRescheduleDelayMillis; return G1RemSetFreeMemoryRescheduleDelayMillis;
} }
G1CardSetFreeMemoryTask::G1CardSetFreeMemoryTask(const char* name) : G1SegmentedArrayFreeMemoryTask::G1SegmentedArrayFreeMemoryTask(const char* name) :
G1ServiceTask(name), _state(State::CalculateUsed), _return_info(nullptr) { } G1ServiceTask(name), _state(State::CalculateUsed), _return_info(nullptr) { }
void G1CardSetFreeMemoryTask::execute() { void G1SegmentedArrayFreeMemoryTask::execute() {
SuspendibleThreadSetJoiner sts; SuspendibleThreadSetJoiner sts;
if (free_excess_card_set_memory()) { if (free_excess_segmented_array_memory()) {
schedule(reschedule_delay_ms()); schedule(reschedule_delay_ms());
} }
} }
void G1CardSetFreeMemoryTask::notify_new_stats(G1CardSetMemoryStats* young_gen_stats, void G1SegmentedArrayFreeMemoryTask::notify_new_stats(G1SegmentedArrayMemoryStats* young_gen_stats,
G1CardSetMemoryStats* collection_set_candidate_stats) { G1SegmentedArrayMemoryStats* collection_set_candidate_stats) {
assert_at_safepoint_on_vm_thread(); assert_at_safepoint_on_vm_thread();
_total_used = *young_gen_stats; _total_used = *young_gen_stats;

View File

@ -22,17 +22,18 @@
* *
*/ */
#ifndef SHARE_GC_G1_G1CARDSETFREEMEMORYTASK_HPP #ifndef SHARE_GC_G1_G1SEGMENTEDARRAYFREEMEMORYTASK_HPP
#define SHARE_GC_G1_G1CARDSETFREEMEMORYTASK_HPP #define SHARE_GC_G1_G1SEGMENTEDARRAYFREEMEMORYTASK_HPP
#include "gc/g1/g1ServiceThread.hpp"
#include "gc/g1/g1CardSetMemory.hpp" #include "gc/g1/g1CardSetMemory.hpp"
#include "gc/g1/g1SegmentedArrayFreePool.hpp"
#include "gc/g1/g1ServiceThread.hpp"
#include "gc/g1/heapRegionRemSet.hpp" #include "gc/g1/heapRegionRemSet.hpp"
#include "utilities/growableArray.hpp" #include "utilities/growableArray.hpp"
#include "utilities/ticks.hpp" #include "utilities/ticks.hpp"
// Task handling deallocation of free card set memory. // Task handling deallocation of free segmented array memory.
class G1CardSetFreeMemoryTask : public G1ServiceTask { class G1SegmentedArrayFreeMemoryTask : public G1ServiceTask {
enum class State : uint { enum class State : uint {
Inactive, Inactive,
@ -52,11 +53,11 @@ class G1CardSetFreeMemoryTask : public G1ServiceTask {
State _state; State _state;
// Current total card set memory usage. // Current total segmented array memory usage.
G1CardSetMemoryStats _total_used; G1SegmentedArrayMemoryStats _total_used;
typedef G1CardSetFreePool::G1ReturnMemoryProcessor G1ReturnMemoryProcessor; typedef G1SegmentedArrayFreePool<mtGCCardSet>::G1ReturnMemoryProcessor G1ReturnMemoryProcessor;
typedef G1CardSetFreePool::G1ReturnMemoryProcessorSet G1ReturnMemoryProcessorSet; typedef G1SegmentedArrayFreePool<mtGCCardSet>::G1ReturnMemoryProcessorSet G1ReturnMemoryProcessorSet;
G1ReturnMemoryProcessorSet* _return_info; G1ReturnMemoryProcessorSet* _return_info;
@ -70,9 +71,9 @@ class G1CardSetFreeMemoryTask : public G1ServiceTask {
bool return_memory_to_os(jlong deadline); bool return_memory_to_os(jlong deadline);
bool cleanup_return_infos(); bool cleanup_return_infos();
// Free excess card set memory, main method. Returns true if there is more work // Free excess segmented array memory, main method. Returns true if there is more work
// to do. // to do.
bool free_excess_card_set_memory(); bool free_excess_segmented_array_memory();
void set_state(State new_state); void set_state(State new_state);
// Returns whether we are currently processing a recent request. // Returns whether we are currently processing a recent request.
@ -82,14 +83,14 @@ class G1CardSetFreeMemoryTask : public G1ServiceTask {
jlong reschedule_delay_ms() const; jlong reschedule_delay_ms() const;
public: public:
explicit G1CardSetFreeMemoryTask(const char* name); explicit G1SegmentedArrayFreeMemoryTask(const char* name);
void execute() override; void execute() override;
// Notify the task of new used remembered set memory statistics for the young // Notify the task of new used remembered set memory statistics for the young
// generation and the collection set candidate sets. // generation and the collection set candidate sets.
void notify_new_stats(G1CardSetMemoryStats* young_gen_stats, void notify_new_stats(G1SegmentedArrayMemoryStats* young_gen_stats,
G1CardSetMemoryStats* collection_set_candidate_stats); G1SegmentedArrayMemoryStats* collection_set_candidate_stats);
}; };
#endif // SHARE_GC_G1_G1CARDSETFREEMEMORYTASK_HPP #endif // SHARE_GC_G1_G1SEGMENTEDARRAYFREEMEMORYTASK_HPP

View File

@ -24,7 +24,6 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/g1/g1CardSetMemory.hpp"
#include "gc/g1/g1SegmentedArrayFreePool.hpp" #include "gc/g1/g1SegmentedArrayFreePool.hpp"
#include "gc/g1/g1SegmentedArray.inline.hpp" #include "gc/g1/g1SegmentedArray.inline.hpp"
#include "logging/log.hpp" #include "logging/log.hpp"
@ -33,19 +32,19 @@
#include "utilities/formatBuffer.hpp" #include "utilities/formatBuffer.hpp"
#include "utilities/ostream.hpp" #include "utilities/ostream.hpp"
G1SegmentedArrayMemoryStats::G1SegmentedArrayMemoryStats() {
G1CardSetMemoryStats::G1CardSetMemoryStats() {
clear(); clear();
} }
void G1CardSetMemoryStats::clear() { void G1SegmentedArrayMemoryStats::clear() {
for (uint i = 0; i < num_pools(); i++) { for (uint i = 0; i < num_pools(); i++) {
_num_mem_sizes[i] = 0; _num_mem_sizes[i] = 0;
_num_buffers[i] = 0; _num_segments[i] = 0;
} }
} }
void G1CardSetFreePool::update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processor) { template<MEMFLAGS flag>
void G1SegmentedArrayFreePool<flag>::update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processor) {
uint num_free_lists = _freelist_pool.num_free_lists(); uint num_free_lists = _freelist_pool.num_free_lists();
for (uint i = 0; i < num_free_lists; i++) { for (uint i = 0; i < num_free_lists; i++) {
@ -53,7 +52,8 @@ void G1CardSetFreePool::update_unlink_processors(G1ReturnMemoryProcessorSet* unl
} }
} }
void G1CardSetFreePool::G1ReturnMemoryProcessor::visit_free_list(G1CardSetBufferList* source) { template<MEMFLAGS flag>
void G1SegmentedArrayFreePool<flag>::G1ReturnMemoryProcessor::visit_free_list(G1SegmentedArrayBufferList<flag>* source) {
assert(_source == nullptr, "already visited"); assert(_source == nullptr, "already visited");
if (_return_to_vm_size > 0) { if (_return_to_vm_size > 0) {
_source = source; _source = source;
@ -75,15 +75,16 @@ void G1CardSetFreePool::G1ReturnMemoryProcessor::visit_free_list(G1CardSetBuffer
} }
} }
bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) { template<MEMFLAGS flag>
bool G1SegmentedArrayFreePool<flag>::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) {
assert(!finished_return_to_vm(), "already returned everything to the VM"); assert(!finished_return_to_vm(), "already returned everything to the VM");
assert(_first != nullptr, "must have element to return"); assert(_first != nullptr, "must have element to return");
size_t keep_size = 0; size_t keep_size = 0;
size_t keep_num = 0; size_t keep_num = 0;
G1CardSetBuffer* cur = _first; G1SegmentedArrayBuffer<flag>* cur = _first;
G1CardSetBuffer* last = nullptr; G1SegmentedArrayBuffer<flag>* last = nullptr;
while (cur != nullptr && _return_to_vm_size > 0) { while (cur != nullptr && _return_to_vm_size > 0) {
size_t cur_size = cur->mem_size(); size_t cur_size = cur->mem_size();
@ -110,7 +111,7 @@ bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) {
_source->bulk_add(*_first, *last, keep_num, keep_size); _source->bulk_add(*_first, *last, keep_num, keep_size);
_first = cur; _first = cur;
log_trace(gc, task)("Card Set Free Memory: Returned to VM %zu buffers size %zu", keep_num, keep_size); log_trace(gc, task)("Segmented Array Free Memory: Returned to VM %zu buffers size %zu", keep_num, keep_size);
// _return_to_vm_size may be larger than what is available in the list at the // _return_to_vm_size may be larger than what is available in the list at the
// time we actually get the list. I.e. the list and _return_to_vm_size may be // time we actually get the list. I.e. the list and _return_to_vm_size may be
@ -124,7 +125,8 @@ bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_vm(jlong deadline) {
return _source != nullptr; return _source != nullptr;
} }
bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) { template<MEMFLAGS flag>
bool G1SegmentedArrayFreePool<flag>::G1ReturnMemoryProcessor::return_to_os(jlong deadline) {
assert(finished_return_to_vm(), "not finished returning to VM"); assert(finished_return_to_vm(), "not finished returning to VM");
assert(!finished_return_to_os(), "already returned everything to the OS"); assert(!finished_return_to_os(), "already returned everything to the OS");
@ -133,7 +135,7 @@ bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) {
size_t mem_size_deleted = 0; size_t mem_size_deleted = 0;
while (_first != nullptr) { while (_first != nullptr) {
G1CardSetBuffer* next = _first->next(); G1SegmentedArrayBuffer<flag>* next = _first->next();
num_delete++; num_delete++;
mem_size_deleted += _first->mem_size(); mem_size_deleted += _first->mem_size();
delete _first; delete _first;
@ -145,45 +147,45 @@ bool G1CardSetFreePool::G1ReturnMemoryProcessor::return_to_os(jlong deadline) {
} }
} }
log_trace(gc, task)("Card Set Free Memory: Return to OS %zu buffers size %zu", num_delete, mem_size_deleted); log_trace(gc, task)("Segmented Array Free Memory: Return to OS %zu buffers size %zu", num_delete, mem_size_deleted);
return _first != nullptr; return _first != nullptr;
} }
G1CardSetFreePool G1CardSetFreePool::_freelist_pool(G1CardSetConfiguration::num_mem_object_types()); template<MEMFLAGS flag>
G1SegmentedArrayFreePool<flag> G1SegmentedArrayFreePool<flag>::_freelist_pool(G1CardSetConfiguration::num_mem_object_types());
G1CardSetFreePool::G1CardSetFreePool(uint num_free_lists) : template<MEMFLAGS flag>
G1SegmentedArrayFreePool<flag>::G1SegmentedArrayFreePool(uint num_free_lists) :
_num_free_lists(num_free_lists) { _num_free_lists(num_free_lists) {
_free_lists = NEW_C_HEAP_ARRAY(G1CardSetBufferList, _num_free_lists, mtGC); _free_lists = NEW_C_HEAP_ARRAY(G1SegmentedArrayBufferList<flag>, _num_free_lists, mtGC);
for (uint i = 0; i < _num_free_lists; i++) { for (uint i = 0; i < _num_free_lists; i++) {
new (&_free_lists[i]) G1CardSetBufferList(); new (&_free_lists[i]) G1SegmentedArrayBufferList<flag>();
} }
} }
G1CardSetFreePool::~G1CardSetFreePool() { template<MEMFLAGS flag>
G1SegmentedArrayFreePool<flag>::~G1SegmentedArrayFreePool() {
for (uint i = 0; i < _num_free_lists; i++) { for (uint i = 0; i < _num_free_lists; i++) {
_free_lists[i].~G1CardSetBufferList(); _free_lists[i].~G1SegmentedArrayBufferList<flag>();
} }
FREE_C_HEAP_ARRAY(mtGC, _free_lists); FREE_C_HEAP_ARRAY(mtGC, _free_lists);
} }
G1CardSetBufferList* G1CardSetFreePool::free_list(uint i) { template<MEMFLAGS flag>
assert(i < _num_free_lists, "must be"); G1SegmentedArrayMemoryStats G1SegmentedArrayFreePool<flag>::memory_sizes() const {
return &_free_lists[i]; G1SegmentedArrayMemoryStats free_list_stats;
}
G1CardSetMemoryStats G1CardSetFreePool::memory_sizes() const {
G1CardSetMemoryStats free_list_stats;
assert(free_list_stats.num_pools() == num_free_lists(), "must be"); assert(free_list_stats.num_pools() == num_free_lists(), "must be");
for (uint i = 0; i < num_free_lists(); i++) { for (uint i = 0; i < num_free_lists(); i++) {
free_list_stats._num_mem_sizes[i] = _free_lists[i].mem_size(); free_list_stats._num_mem_sizes[i] = _free_lists[i].mem_size();
free_list_stats._num_buffers[i] = _free_lists[i].num_buffers(); free_list_stats._num_segments[i] = _free_lists[i].num_buffers();
} }
return free_list_stats; return free_list_stats;
} }
size_t G1CardSetFreePool::mem_size() const { template<MEMFLAGS flag>
size_t G1SegmentedArrayFreePool<flag>::mem_size() const {
size_t result = 0; size_t result = 0;
for (uint i = 0; i < _num_free_lists; i++) { for (uint i = 0; i < _num_free_lists; i++) {
result += _free_lists[i].mem_size(); result += _free_lists[i].mem_size();
@ -191,10 +193,13 @@ size_t G1CardSetFreePool::mem_size() const {
return result; return result;
} }
void G1CardSetFreePool::print_on(outputStream* out) { template<MEMFLAGS flag>
void G1SegmentedArrayFreePool<flag>::print_on(outputStream* out) {
out->print_cr(" Free Pool: size %zu", free_list_pool()->mem_size()); out->print_cr(" Free Pool: size %zu", free_list_pool()->mem_size());
for (uint i = 0; i < _num_free_lists; i++) { for (uint i = 0; i < _num_free_lists; i++) {
FormatBuffer<> fmt(" %s", G1CardSetConfiguration::mem_object_type_name_str(i)); FormatBuffer<> fmt(" %s", G1CardSetConfiguration::mem_object_type_name_str(i));
_free_lists[i].print_on(out, fmt); _free_lists[i].print_on(out, fmt);
} }
} }
template class G1SegmentedArrayFreePool<mtGCCardSet>;

View File

@ -21,6 +21,7 @@
* questions. * questions.
* *
*/ */
#ifndef SHARE_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP #ifndef SHARE_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP
#define SHARE_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP #define SHARE_GC_G1_G1SEGMENTEDARRAYFREEPOOL_HPP
@ -28,23 +29,23 @@
#include "gc/g1/g1SegmentedArray.hpp" #include "gc/g1/g1SegmentedArray.hpp"
#include "utilities/growableArray.hpp" #include "utilities/growableArray.hpp"
// Statistics for a fixed set of buffer lists. Contains the number of buffers and memory // Statistics for a segmented array. Contains the number of segments and memory
// used for each. Note that statistics are typically not taken atomically so there // used for each. Note that statistics are typically not taken atomically so there
// can be inconsistencies. The user must be prepared for them. // can be inconsistencies. The user must be prepared for them.
class G1CardSetMemoryStats { class G1SegmentedArrayMemoryStats {
public: public:
size_t _num_mem_sizes[G1CardSetConfiguration::num_mem_object_types()]; size_t _num_mem_sizes[G1CardSetConfiguration::num_mem_object_types()];
size_t _num_buffers[G1CardSetConfiguration::num_mem_object_types()]; size_t _num_segments[G1CardSetConfiguration::num_mem_object_types()];
// Returns all-zero statistics. // Returns all-zero statistics.
G1CardSetMemoryStats(); G1SegmentedArrayMemoryStats();
void add(G1CardSetMemoryStats const other) { void add(G1SegmentedArrayMemoryStats const other) {
STATIC_ASSERT(ARRAY_SIZE(_num_buffers) == ARRAY_SIZE(_num_mem_sizes)); STATIC_ASSERT(ARRAY_SIZE(_num_segments) == ARRAY_SIZE(_num_mem_sizes));
for (uint i = 0; i < ARRAY_SIZE(_num_mem_sizes); i++) { for (uint i = 0; i < ARRAY_SIZE(_num_mem_sizes); i++) {
_num_mem_sizes[i] += other._num_mem_sizes[i]; _num_mem_sizes[i] += other._num_mem_sizes[i];
_num_buffers[i] += other._num_buffers[i]; _num_segments[i] += other._num_segments[i];
} }
} }
@ -53,46 +54,49 @@ public:
uint num_pools() const { return G1CardSetConfiguration::num_mem_object_types(); } uint num_pools() const { return G1CardSetConfiguration::num_mem_object_types(); }
}; };
typedef G1SegmentedArrayBuffer<mtGCCardSet> G1CardSetBuffer; // A set of free lists holding memory buffers for use by G1SegmentedArray,
typedef G1SegmentedArrayBufferList<mtGCCardSet> G1CardSetBufferList; // e.g. G1CardSetAllocators::SegmentedArray
template<MEMFLAGS flag>
// A set of free lists holding memory buffers for use by G1CardSetAllocators. class G1SegmentedArrayFreePool {
class G1CardSetFreePool {
// The global free pool. // The global free pool.
static G1CardSetFreePool _freelist_pool; static G1SegmentedArrayFreePool _freelist_pool;
const uint _num_free_lists; const uint _num_free_lists;
G1CardSetBufferList* _free_lists; G1SegmentedArrayBufferList<flag>* _free_lists;
public: public:
static G1CardSetFreePool* free_list_pool() { return &_freelist_pool; } static G1SegmentedArrayFreePool* free_list_pool() { return &_freelist_pool; }
static G1CardSetMemoryStats free_list_sizes() { return _freelist_pool.memory_sizes(); } static G1SegmentedArrayMemoryStats free_list_sizes() { return _freelist_pool.memory_sizes(); }
class G1ReturnMemoryProcessor; class G1ReturnMemoryProcessor;
typedef GrowableArrayCHeap<G1ReturnMemoryProcessor*, mtGC> G1ReturnMemoryProcessorSet; typedef GrowableArrayCHeap<G1ReturnMemoryProcessor*, mtGC> G1ReturnMemoryProcessorSet;
static void update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processors); static void update_unlink_processors(G1ReturnMemoryProcessorSet* unlink_processors);
explicit G1CardSetFreePool(uint num_free_lists); explicit G1SegmentedArrayFreePool(uint num_free_lists);
~G1CardSetFreePool(); ~G1SegmentedArrayFreePool();
G1CardSetBufferList* free_list(uint i); G1SegmentedArrayBufferList<flag>* free_list(uint i) {
assert(i < _num_free_lists, "must be");
return &_free_lists[i];
}
uint num_free_lists() const { return _num_free_lists; } uint num_free_lists() const { return _num_free_lists; }
G1CardSetMemoryStats memory_sizes() const; G1SegmentedArrayMemoryStats memory_sizes() const;
size_t mem_size() const; size_t mem_size() const;
void print_on(outputStream* out); void print_on(outputStream* out);
}; };
// Data structure containing current in-progress state for returning memory to the // Data structure containing current in-progress state for returning memory to the
// operating system for a single G1CardSetBufferList. // operating system for a single G1SegmentedArrayBufferList.
class G1CardSetFreePool::G1ReturnMemoryProcessor : public CHeapObj<mtGC> { template<MEMFLAGS flag>
G1CardSetBufferList* _source; class G1SegmentedArrayFreePool<flag>::G1ReturnMemoryProcessor : public CHeapObj<mtGC> {
G1SegmentedArrayBufferList<flag>* _source;
size_t _return_to_vm_size; size_t _return_to_vm_size;
G1CardSetBuffer* _first; G1SegmentedArrayBuffer<flag>* _first;
size_t _unlinked_bytes; size_t _unlinked_bytes;
size_t _num_unlinked; size_t _num_unlinked;
@ -101,10 +105,10 @@ public:
_source(nullptr), _return_to_vm_size(return_to_vm), _first(nullptr), _unlinked_bytes(0), _num_unlinked(0) { _source(nullptr), _return_to_vm_size(return_to_vm), _first(nullptr), _unlinked_bytes(0), _num_unlinked(0) {
} }
// Updates the instance members about the given card set buffer list for the purpose // Updates the instance members about the given segmented array buffer list for
// of giving back memory. Only necessary members are updated, e.g. if there is // the purpose of giving back memory. Only necessary members are updated,
// nothing to return to the VM, do not set the source list. // e.g. if there is nothing to return to the VM, do not set the source list.
void visit_free_list(G1CardSetBufferList* source); void visit_free_list(G1SegmentedArrayBufferList<flag>* source);
bool finished_return_to_vm() const { return _return_to_vm_size == 0; } bool finished_return_to_vm() const { return _return_to_vm_size == 0; }
bool finished_return_to_os() const { return _first == nullptr; } bool finished_return_to_os() const { return _first == nullptr; }

View File

@ -330,7 +330,7 @@ class G1PrepareEvacuationTask : public WorkerTask {
uint _worker_humongous_total; uint _worker_humongous_total;
uint _worker_humongous_candidates; uint _worker_humongous_candidates;
G1CardSetMemoryStats _card_set_stats; G1SegmentedArrayMemoryStats _card_set_stats;
void sample_card_set_size(HeapRegion* hr) { void sample_card_set_size(HeapRegion* hr) {
// Sample card set sizes for young gen and humongous before GC: this makes // Sample card set sizes for young gen and humongous before GC: this makes
@ -446,7 +446,7 @@ class G1PrepareEvacuationTask : public WorkerTask {
return false; return false;
} }
G1CardSetMemoryStats card_set_stats() const { G1SegmentedArrayMemoryStats card_set_stats() const {
return _card_set_stats; return _card_set_stats;
} }
}; };
@ -456,7 +456,7 @@ class G1PrepareEvacuationTask : public WorkerTask {
volatile uint _humongous_total; volatile uint _humongous_total;
volatile uint _humongous_candidates; volatile uint _humongous_candidates;
G1CardSetMemoryStats _all_card_set_stats; G1SegmentedArrayMemoryStats _all_card_set_stats;
public: public:
G1PrepareEvacuationTask(G1CollectedHeap* g1h) : G1PrepareEvacuationTask(G1CollectedHeap* g1h) :
@ -490,7 +490,7 @@ public:
return _humongous_total; return _humongous_total;
} }
const G1CardSetMemoryStats all_card_set_stats() const { const G1SegmentedArrayMemoryStats all_card_set_stats() const {
return _all_card_set_stats; return _all_card_set_stats;
} }
}; };

View File

@ -33,7 +33,6 @@
class WorkerTask; class WorkerTask;
class G1Allocator; class G1Allocator;
class G1BatchedTask; class G1BatchedTask;
class G1CardSetMemoryStats;
class G1CollectedHeap; class G1CollectedHeap;
class G1CollectionSet; class G1CollectionSet;
class G1CollectorState; class G1CollectorState;
@ -49,6 +48,7 @@ class G1ParScanThreadStateSet;
class G1Policy; class G1Policy;
class G1RedirtyCardsQueueSet; class G1RedirtyCardsQueueSet;
class G1RemSet; class G1RemSet;
class G1SegmentedArrayMemoryStats;
class G1SurvivorRegions; class G1SurvivorRegions;
class G1YoungGCEvacFailureInjector; class G1YoungGCEvacFailureInjector;
class STWGCTimer; class STWGCTimer;

View File

@ -82,7 +82,7 @@ public:
class G1SampleCollectionSetCandidatesClosure : public HeapRegionClosure { class G1SampleCollectionSetCandidatesClosure : public HeapRegionClosure {
public: public:
G1CardSetMemoryStats _total; G1SegmentedArrayMemoryStats _total;
bool do_heap_region(HeapRegion* r) override { bool do_heap_region(HeapRegion* r) override {
_total.add(r->rem_set()->card_set_memory_stats()); _total.add(r->rem_set()->card_set_memory_stats());

View File

@ -38,7 +38,6 @@
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
class G1CardSetConfiguration; class G1CardSetConfiguration;
class G1CardSetMemoryManager;
class G1CollectedHeap; class G1CollectedHeap;
class G1CMBitMap; class G1CMBitMap;
class G1Predictions; class G1Predictions;

View File

@ -81,7 +81,7 @@ HeapRegionRemSet::HeapRegionRemSet(HeapRegion* hr,
G1CardSetConfiguration* config) : G1CardSetConfiguration* config) :
_m(Mutex::service - 1, FormatBuffer<128>("HeapRegionRemSet#%u_lock", hr->hrm_index())), _m(Mutex::service - 1, FormatBuffer<128>("HeapRegionRemSet#%u_lock", hr->hrm_index())),
_code_roots(), _code_roots(),
_card_set_mm(config, G1CardSetFreePool::free_list_pool()), _card_set_mm(config, G1SegmentedArrayFreePool<mtGCCardSet>::free_list_pool()),
_card_set(config, &_card_set_mm), _card_set(config, &_card_set_mm),
_hr(hr), _hr(hr),
_state(Untracked) { } _state(Untracked) { }
@ -105,6 +105,10 @@ void HeapRegionRemSet::clear_locked(bool only_cardset) {
assert(occupied() == 0, "Should be clear."); assert(occupied() == 0, "Should be clear.");
} }
G1SegmentedArrayMemoryStats HeapRegionRemSet::card_set_memory_stats() const {
return _card_set_mm.memory_stats();
}
void HeapRegionRemSet::print_static_mem_size(outputStream* out) { void HeapRegionRemSet::print_static_mem_size(outputStream* out) {
out->print_cr(" Static structures = " SIZE_FORMAT, HeapRegionRemSet::static_mem_size()); out->print_cr(" Static structures = " SIZE_FORMAT, HeapRegionRemSet::static_mem_size());
} }

View File

@ -33,6 +33,7 @@
#include "runtime/safepoint.hpp" #include "runtime/safepoint.hpp"
#include "utilities/bitMap.hpp" #include "utilities/bitMap.hpp"
class G1CardSetMemoryManager;
class outputStream; class outputStream;
class HeapRegionRemSet : public CHeapObj<mtGC> { class HeapRegionRemSet : public CHeapObj<mtGC> {
@ -125,7 +126,7 @@ public:
void clear(bool only_cardset = false); void clear(bool only_cardset = false);
void clear_locked(bool only_cardset = false); void clear_locked(bool only_cardset = false);
G1CardSetMemoryStats card_set_memory_stats() const { return _card_set_mm.memory_stats(); } G1SegmentedArrayMemoryStats card_set_memory_stats() const;
// The actual # of bytes this hr_remset takes up. Also includes the strong code // The actual # of bytes this hr_remset takes up. Also includes the strong code
// root set. // root set.

View File

@ -25,10 +25,12 @@
#include "gc/g1/g1CardSet.inline.hpp" #include "gc/g1/g1CardSet.inline.hpp"
#include "gc/g1/g1CardSetContainers.hpp" #include "gc/g1/g1CardSetContainers.hpp"
#include "gc/g1/g1CardSetMemory.hpp" #include "gc/g1/g1CardSetMemory.hpp"
#include "gc/g1/g1SegmentedArrayFreePool.hpp"
#include "gc/g1/heapRegionRemSet.hpp" #include "gc/g1/heapRegionRemSet.hpp"
#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/workerThread.hpp" #include "gc/shared/workerThread.hpp"
#include "logging/log.hpp" #include "logging/log.hpp"
#include "memory/allocation.hpp"
#include "unittest.hpp" #include "unittest.hpp"
#include "utilities/powerOfTwo.hpp" #include "utilities/powerOfTwo.hpp"