Skip to content

Commit

Permalink
8298191: Enhance object reclamation process
Browse files Browse the repository at this point in the history
Reviewed-by: phh
Backport-of: 780327d1de4fee3e77c3e48018908bf0c3fcd55a
  • Loading branch information
Andrew Brygin authored and gnu-andrew committed Apr 18, 2023
1 parent ed70f64 commit 1a42e35
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
Expand Up @@ -161,7 +161,6 @@ class DirtyCardQueueSet: public PtrQueueSet {

// If any threads have partial logs, add them to the global list of logs.
void concatenate_logs();
void clear_n_completed_buffers() { _n_completed_buffers = 0;}

jint processed_buffers_mut() {
return _processed_buffers_mut;
Expand Down
Expand Up @@ -2287,7 +2287,6 @@ void G1CollectedHeap::iterate_dirty_card_closure(CardTableEntryClosure* cl,
n_completed_buffers++;
}
g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, n_completed_buffers);
dcqs.clear_n_completed_buffers();
assert(!dcqs.completed_buffers_exist_dirty(), "Completed buffers exist!");
}

Expand Down
3 changes: 1 addition & 2 deletions hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp
Expand Up @@ -377,9 +377,8 @@ void G1RemSet::cleanup_after_oops_into_collection_set_do() {
// Free any completed buffers in the DirtyCardQueueSet used to hold cards
// which contain references that point into the collection.
_g1->into_cset_dirty_card_queue_set().clear();
assert(_g1->into_cset_dirty_card_queue_set().completed_buffers_num() == 0,
assert(!_g1->into_cset_dirty_card_queue_set().completed_buffers_exist_dirty(),
"all buffers should be freed");
_g1->into_cset_dirty_card_queue_set().clear_n_completed_buffers();
}

class ScrubRSClosure: public HeapRegionClosure {
Expand Down
2 changes: 1 addition & 1 deletion hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp
Expand Up @@ -279,7 +279,7 @@ class PtrQueueSet VALUE_OBJ_CLASS_SPEC {
bool process_or_enqueue_complete_buffer(void** buf);

bool completed_buffers_exist_dirty() {
return _n_completed_buffers > 0;
return _n_completed_buffers > 0 || _completed_buffers_head != NULL;
}

bool process_completed_buffers() { return _process_completed; }
Expand Down

0 comments on commit 1a42e35

Please sign in to comment.