< prev index next >
src/share/vm/gc/g1/g1CollectedHeap.cpp
Print this page
rev 10808 : imported patch eager-reclaim-alive-check
*** 2938,2954 ****
return G1EagerReclaimHumongousObjectsWithStaleRefs
? rset->occupancy_less_or_equal_than(G1RSetSparseRegionEntries)
: rset->is_empty();
}
- bool is_typeArray_region(HeapRegion* region) const {
- return oop(region->bottom())->is_typeArray();
- }
-
bool humongous_region_is_candidate(G1CollectedHeap* heap, HeapRegion* region) const {
assert(region->is_starts_humongous(), "Must start a humongous object");
// Candidate selection must satisfy the following constraints
// while concurrent marking is in progress:
//
// * In order to maintain SATB invariants, an object must not be
// reclaimed if it was allocated before the start of marking and
--- 2938,2958 ----
return G1EagerReclaimHumongousObjectsWithStaleRefs
? rset->occupancy_less_or_equal_than(G1RSetSparseRegionEntries)
: rset->is_empty();
}
bool humongous_region_is_candidate(G1CollectedHeap* heap, HeapRegion* region) const {
assert(region->is_starts_humongous(), "Must start a humongous object");
+ oop obj = oop(region->bottom());
+
+ // Dead objects cannot be eager reclaim candidates. Due to class
+ // unloading it is unsafe to query their classes so we return early.
+ if (heap->is_obj_dead(obj, region)) {
+ return false;
+ }
+
// Candidate selection must satisfy the following constraints
// while concurrent marking is in progress:
//
// * In order to maintain SATB invariants, an object must not be
// reclaimed if it was allocated before the start of marking and
*** 2981,2991 ****
// such objects to be built-in and so ensured to be kept live.
// Frequent allocation and drop of large binary blobs is an
// important use case for eager reclaim, and this special handling
// may reduce needed headroom.
! return is_typeArray_region(region) && is_remset_small(region);
}
public:
RegisterHumongousWithInCSetFastTestClosure()
: _total_humongous(0),
--- 2985,2995 ----
// such objects to be built-in and so ensured to be kept live.
// Frequent allocation and drop of large binary blobs is an
// important use case for eager reclaim, and this special handling
// may reduce needed headroom.
! return obj->is_typeArray() && is_remset_small(region);
}
public:
RegisterHumongousWithInCSetFastTestClosure()
: _total_humongous(0),
< prev index next >