mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-21 10:57:56 +00:00
8200385: Eagerly reclaimed humongous objects leave mark in prev bitmap
Also clear marks on prev bitmap on eager reclaim Reviewed-by: sangheki, sjohanss
This commit is contained in:
parent
2dfa53af63
commit
4fd82a111e
@ -4691,7 +4691,13 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure {
|
||||
obj->is_typeArray()
|
||||
);
|
||||
|
||||
g1h->concurrent_mark()->humongous_object_eagerly_reclaimed(r);
|
||||
G1ConcurrentMark* const cm = g1h->concurrent_mark();
|
||||
cm->humongous_object_eagerly_reclaimed(r);
|
||||
assert(!cm->is_marked_in_prev_bitmap(obj) && !cm->is_marked_in_next_bitmap(obj),
|
||||
"Eagerly reclaimed humongous region %u should not be marked at all but is in prev %s next %s",
|
||||
region_idx,
|
||||
BOOL_TO_STR(cm->is_marked_in_prev_bitmap(obj)),
|
||||
BOOL_TO_STR(cm->is_marked_in_next_bitmap(obj)));
|
||||
_humongous_objects_reclaimed++;
|
||||
do {
|
||||
HeapRegion* next = g1h->next_region_in_humongous(r);
|
||||
|
||||
@ -530,13 +530,18 @@ void G1ConcurrentMark::clear_statistics(HeapRegion* r) {
|
||||
}
|
||||
}
|
||||
|
||||
static void clear_mark_if_set(G1CMBitMap* bitmap, HeapWord* addr) {
|
||||
if (bitmap->is_marked(addr)) {
|
||||
bitmap->clear(addr);
|
||||
}
|
||||
}
|
||||
|
||||
void G1ConcurrentMark::humongous_object_eagerly_reclaimed(HeapRegion* r) {
|
||||
assert_at_safepoint_on_vm_thread();
|
||||
|
||||
// Need to clear mark bit of the humongous object.
|
||||
if (_next_mark_bitmap->is_marked(r->bottom())) {
|
||||
_next_mark_bitmap->clear(r->bottom());
|
||||
}
|
||||
// Need to clear all mark bits of the humongous object.
|
||||
clear_mark_if_set(_prev_mark_bitmap, r->bottom());
|
||||
clear_mark_if_set(_next_mark_bitmap, r->bottom());
|
||||
|
||||
if (!_g1h->collector_state()->mark_or_rebuild_in_progress()) {
|
||||
return;
|
||||
|
||||
@ -589,6 +589,8 @@ public:
|
||||
inline bool mark_in_next_bitmap(uint worker_id, HeapRegion* const hr, oop const obj, size_t const obj_size = 0);
|
||||
inline bool mark_in_next_bitmap(uint worker_id, oop const obj, size_t const obj_size = 0);
|
||||
|
||||
inline bool is_marked_in_next_bitmap(oop p) const;
|
||||
|
||||
// Returns true if initialization was successfully completed.
|
||||
bool completed_initialization() const {
|
||||
return _completed_initialization;
|
||||
|
||||
@ -255,6 +255,11 @@ bool G1ConcurrentMark::is_marked_in_prev_bitmap(oop p) const {
|
||||
return _prev_mark_bitmap->is_marked((HeapWord*)p);
|
||||
}
|
||||
|
||||
bool G1ConcurrentMark::is_marked_in_next_bitmap(oop p) const {
|
||||
assert(p != NULL && oopDesc::is_oop(p), "expected an oop");
|
||||
return _next_mark_bitmap->is_marked((HeapWord*)p);
|
||||
}
|
||||
|
||||
inline bool G1ConcurrentMark::do_yield_check() {
|
||||
if (SuspendibleThreadSet::should_yield()) {
|
||||
SuspendibleThreadSet::yield();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user