mirror of
https://github.com/darlinghq/darling-openjdk.git
synced 2024-11-23 12:29:56 +00:00
8242082: Shenandoah: Purge Traversal mode
Reviewed-by: shade
This commit is contained in:
parent
ac7e4143d8
commit
a385f3a4c6
@ -156,7 +156,7 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm,
|
||||
Address buffer(thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset()));
|
||||
|
||||
Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
|
||||
__ testb(gc_state, ShenandoahHeap::MARKING | ShenandoahHeap::TRAVERSAL);
|
||||
__ testb(gc_state, ShenandoahHeap::MARKING);
|
||||
__ jcc(Assembler::zero, done);
|
||||
|
||||
// Do we need to load the previous value?
|
||||
@ -891,7 +891,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss
|
||||
|
||||
// Is SATB still active?
|
||||
Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
|
||||
__ testb(gc_state, ShenandoahHeap::MARKING | ShenandoahHeap::TRAVERSAL);
|
||||
__ testb(gc_state, ShenandoahHeap::MARKING);
|
||||
__ jcc(Assembler::zero, done);
|
||||
|
||||
// Can we store original value in the thread's buffer?
|
||||
|
@ -108,9 +108,6 @@ const char* GCCause::to_string(GCCause::Cause cause) {
|
||||
case _shenandoah_concurrent_gc:
|
||||
return "Concurrent GC";
|
||||
|
||||
case _shenandoah_traversal_gc:
|
||||
return "Traversal GC";
|
||||
|
||||
case _shenandoah_upgrade_to_full_gc:
|
||||
return "Upgrade To Full GC";
|
||||
|
||||
|
@ -78,7 +78,6 @@ class GCCause : public AllStatic {
|
||||
_shenandoah_stop_vm,
|
||||
_shenandoah_allocation_failure_evac,
|
||||
_shenandoah_concurrent_gc,
|
||||
_shenandoah_traversal_gc,
|
||||
_shenandoah_upgrade_to_full_gc,
|
||||
|
||||
_z_timer,
|
||||
|
@ -134,9 +134,7 @@ LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, L
|
||||
// Read and check the gc-state-flag.
|
||||
LIR_Opr flag_val = gen->new_register(T_INT);
|
||||
__ load(active_flag_addr, flag_val);
|
||||
LIR_Opr mask = LIR_OprFact::intConst(ShenandoahHeap::HAS_FORWARDED |
|
||||
ShenandoahHeap::EVACUATION |
|
||||
ShenandoahHeap::TRAVERSAL);
|
||||
LIR_Opr mask = LIR_OprFact::intConst(ShenandoahHeap::HAS_FORWARDED);
|
||||
LIR_Opr mask_reg = gen->new_register(T_INT);
|
||||
__ move(mask, mask_reg);
|
||||
|
||||
@ -224,8 +222,7 @@ void ShenandoahBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result)
|
||||
bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0;
|
||||
bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
|
||||
bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
|
||||
bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
|
||||
bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0 || is_traversal_mode;
|
||||
bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
|
||||
|
||||
if ((is_weak || is_phantom || is_anonymous) && keep_alive) {
|
||||
// Register the value in the referent field with the pre-barrier
|
||||
|
@ -565,8 +565,7 @@ Node* ShenandoahBarrierSetC2::load_at_resolved(C2Access& access, const Type* val
|
||||
|
||||
bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0;
|
||||
bool on_weak_ref = (decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF)) != 0;
|
||||
bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
|
||||
bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0 || is_traversal_mode;
|
||||
bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
|
||||
|
||||
// If we are reading the value of the referent field of a Reference
|
||||
// object (either by using Unsafe directly or through reflection)
|
||||
|
@ -1,130 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
|
||||
#include "gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.hpp"
|
||||
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
|
||||
#include "gc/shenandoah/shenandoahFreeSet.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeuristics.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "logging/logTag.hpp"
|
||||
#include "utilities/quickSort.hpp"
|
||||
|
||||
ShenandoahTraversalAggressiveHeuristics::ShenandoahTraversalAggressiveHeuristics() : ShenandoahHeuristics(),
|
||||
_last_cset_select(0) {
|
||||
// Do not shortcut evacuation
|
||||
SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahImmediateThreshold, 100);
|
||||
|
||||
// Aggressive runs with max speed for allocation, to capture races against mutator
|
||||
SHENANDOAH_ERGO_DISABLE_FLAG(ShenandoahPacing);
|
||||
|
||||
// Aggressive evacuates everything, so it needs as much evac space as it can get
|
||||
SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahEvacReserveOverflow);
|
||||
|
||||
// If class unloading is globally enabled, aggressive does unloading even with
|
||||
// concurrent cycles.
|
||||
if (ClassUnloading) {
|
||||
SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahUnloadClassesFrequency, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool ShenandoahTraversalAggressiveHeuristics::is_experimental() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ShenandoahTraversalAggressiveHeuristics::is_diagnostic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* ShenandoahTraversalAggressiveHeuristics::name() {
|
||||
return "traversal-aggressive";
|
||||
}
|
||||
|
||||
void ShenandoahTraversalAggressiveHeuristics::choose_collection_set(ShenandoahCollectionSet* collection_set) {
|
||||
ShenandoahHeap* heap = ShenandoahHeap::heap();
|
||||
|
||||
ShenandoahTraversalGC* traversal_gc = heap->traversal_gc();
|
||||
|
||||
ShenandoahHeapRegionSet* traversal_set = traversal_gc->traversal_set();
|
||||
traversal_set->clear();
|
||||
|
||||
RegionData *data = get_region_data_cache(heap->num_regions());
|
||||
size_t cnt = 0;
|
||||
|
||||
// About to choose the collection set, make sure we have pinned regions in correct state
|
||||
heap->assert_pinned_region_status();
|
||||
|
||||
// Step 0. Prepare all regions
|
||||
for (size_t i = 0; i < heap->num_regions(); i++) {
|
||||
ShenandoahHeapRegion* r = heap->get_region(i);
|
||||
if (r->used() > 0) {
|
||||
if (r->is_regular()) {
|
||||
data[cnt]._region = r;
|
||||
data[cnt]._garbage = r->garbage();
|
||||
data[cnt]._seqnum_last_alloc = r->seqnum_last_alloc_mutator();
|
||||
cnt++;
|
||||
}
|
||||
traversal_set->add_region(r);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < cnt; i++) {
|
||||
if (data[i]._seqnum_last_alloc > _last_cset_select) continue;
|
||||
|
||||
ShenandoahHeapRegion* r = data[i]._region;
|
||||
assert (r->is_regular(), "should have been filtered before");
|
||||
|
||||
if (r->garbage() > 0) {
|
||||
assert(!collection_set->is_in(r), "must not yet be in cset");
|
||||
collection_set->add_region(r);
|
||||
}
|
||||
}
|
||||
|
||||
// Clear liveness data
|
||||
// TODO: Merge it with step 0, but save live data in RegionData before.
|
||||
for (size_t i = 0; i < heap->num_regions(); i++) {
|
||||
ShenandoahHeapRegion* r = heap->get_region(i);
|
||||
if (r->used() > 0) {
|
||||
r->clear_live_data();
|
||||
}
|
||||
}
|
||||
|
||||
collection_set->update_region_status();
|
||||
|
||||
_last_cset_select = ShenandoahHeapRegion::seqnum_current_alloc();
|
||||
}
|
||||
|
||||
void ShenandoahTraversalAggressiveHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* set,
|
||||
RegionData* data, size_t data_size,
|
||||
size_t free) {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
bool ShenandoahTraversalAggressiveHeuristics::should_start_gc() const {
|
||||
log_info(gc)("Trigger: Start next cycle immediately");
|
||||
return true;
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALAGGRESSIVEHEURISTICS_HPP
|
||||
#define SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALAGGRESSIVEHEURISTICS_HPP
|
||||
|
||||
#include "gc/shenandoah/shenandoahHeuristics.hpp"
|
||||
|
||||
class ShenandoahTraversalAggressiveHeuristics : public ShenandoahHeuristics {
|
||||
private:
|
||||
uint64_t _last_cset_select;
|
||||
|
||||
protected:
|
||||
virtual void choose_collection_set_from_regiondata(ShenandoahCollectionSet* set,
|
||||
RegionData* data, size_t data_size,
|
||||
size_t free);
|
||||
|
||||
public:
|
||||
ShenandoahTraversalAggressiveHeuristics();
|
||||
|
||||
virtual bool is_experimental();
|
||||
|
||||
virtual bool is_diagnostic();
|
||||
|
||||
virtual const char* name();
|
||||
|
||||
virtual void choose_collection_set(ShenandoahCollectionSet* collection_set);
|
||||
virtual bool should_start_gc() const;
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALAGGRESSIVEHEURISTICS_HPP
|
@ -1,257 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
|
||||
#include "gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp"
|
||||
#include "gc/shenandoah/shenandoahCollectionSet.hpp"
|
||||
#include "gc/shenandoah/shenandoahFreeSet.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeuristics.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "logging/logTag.hpp"
|
||||
#include "utilities/quickSort.hpp"
|
||||
|
||||
ShenandoahTraversalHeuristics::ShenandoahTraversalHeuristics() : ShenandoahHeuristics(),
|
||||
_last_cset_select(0) {}
|
||||
|
||||
bool ShenandoahTraversalHeuristics::is_experimental() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ShenandoahTraversalHeuristics::is_diagnostic() {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* ShenandoahTraversalHeuristics::name() {
|
||||
return "traversal";
|
||||
}
|
||||
|
||||
void ShenandoahTraversalHeuristics::choose_collection_set(ShenandoahCollectionSet* collection_set) {
|
||||
ShenandoahHeap* heap = ShenandoahHeap::heap();
|
||||
|
||||
ShenandoahTraversalGC* traversal_gc = heap->traversal_gc();
|
||||
|
||||
ShenandoahHeapRegionSet* traversal_set = traversal_gc->traversal_set();
|
||||
traversal_set->clear();
|
||||
|
||||
RegionData *data = get_region_data_cache(heap->num_regions());
|
||||
size_t cnt = 0;
|
||||
|
||||
// About to choose the collection set, make sure we have pinned regions in correct state
|
||||
heap->assert_pinned_region_status();
|
||||
|
||||
// Step 0. Prepare all regions
|
||||
|
||||
for (size_t i = 0; i < heap->num_regions(); i++) {
|
||||
ShenandoahHeapRegion* r = heap->get_region(i);
|
||||
if (r->used() > 0) {
|
||||
if (r->is_regular()) {
|
||||
data[cnt]._region = r;
|
||||
data[cnt]._garbage = r->garbage();
|
||||
data[cnt]._seqnum_last_alloc = r->seqnum_last_alloc_mutator();
|
||||
cnt++;
|
||||
}
|
||||
traversal_set->add_region(r);
|
||||
}
|
||||
}
|
||||
|
||||
// The logic for cset selection is similar to that of adaptive:
|
||||
//
|
||||
// 1. We cannot get cset larger than available free space. Otherwise we guarantee OOME
|
||||
// during evacuation, and thus guarantee full GC. In practice, we also want to let
|
||||
// application to allocate something. This is why we limit CSet to some fraction of
|
||||
// available space. In non-overloaded heap, max_cset would contain all plausible candidates
|
||||
// over garbage threshold.
|
||||
//
|
||||
// 2. We should not get cset too low so that free threshold would not be met right
|
||||
// after the cycle. Otherwise we get back-to-back cycles for no reason if heap is
|
||||
// too fragmented. In non-overloaded non-fragmented heap min_garbage would be around zero.
|
||||
//
|
||||
// Therefore, we start by sorting the regions by garbage. Then we unconditionally add the best candidates
|
||||
// before we meet min_garbage. Then we add all candidates that fit with a garbage threshold before
|
||||
// we hit max_cset. When max_cset is hit, we terminate the cset selection. Note that in this scheme,
|
||||
// ShenandoahGarbageThreshold is the soft threshold which would be ignored until min_garbage is hit.
|
||||
//
|
||||
// The significant complication is that liveness data was collected at the previous cycle, and only
|
||||
// for those regions that were allocated before previous cycle started.
|
||||
|
||||
size_t capacity = heap->max_capacity();
|
||||
size_t actual_free = heap->free_set()->available();
|
||||
|
||||
size_t max_cset = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste);
|
||||
size_t free_target = (capacity / 100 * ShenandoahMinFreeThreshold) + max_cset;
|
||||
size_t min_garbage = free_target > actual_free ? (free_target - actual_free) : 0;
|
||||
|
||||
log_info(gc, ergo)("Adaptive CSet Selection. Target Free: " SIZE_FORMAT "%s, Actual Free: "
|
||||
SIZE_FORMAT "%s, Max CSet: " SIZE_FORMAT "%s, Min Garbage: " SIZE_FORMAT "%s",
|
||||
byte_size_in_proper_unit(free_target), proper_unit_for_byte_size(free_target),
|
||||
byte_size_in_proper_unit(actual_free), proper_unit_for_byte_size(actual_free),
|
||||
byte_size_in_proper_unit(max_cset), proper_unit_for_byte_size(max_cset),
|
||||
byte_size_in_proper_unit(min_garbage), proper_unit_for_byte_size(min_garbage));
|
||||
|
||||
// Better select garbage-first regions, and then older ones
|
||||
QuickSort::sort<RegionData>(data, (int) cnt, compare_by_garbage_then_alloc_seq_ascending, false);
|
||||
|
||||
size_t cur_cset = 0;
|
||||
size_t cur_garbage = 0;
|
||||
|
||||
size_t garbage_threshold = ShenandoahHeapRegion::region_size_bytes() / 100 * ShenandoahGarbageThreshold;
|
||||
|
||||
// Step 1. Add trustworthy regions to collection set.
|
||||
//
|
||||
// We can trust live/garbage data from regions that were fully traversed during
|
||||
// previous cycle. Even if actual liveness is different now, we can only have _less_
|
||||
// live objects, because dead objects are not resurrected. Which means we can undershoot
|
||||
// the collection set, but not overshoot it.
|
||||
|
||||
for (size_t i = 0; i < cnt; i++) {
|
||||
if (data[i]._seqnum_last_alloc > _last_cset_select) continue;
|
||||
|
||||
ShenandoahHeapRegion* r = data[i]._region;
|
||||
assert (r->is_regular(), "should have been filtered before");
|
||||
|
||||
size_t new_garbage = cur_garbage + r->garbage();
|
||||
size_t new_cset = cur_cset + r->get_live_data_bytes();
|
||||
|
||||
if (new_cset > max_cset) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((new_garbage < min_garbage) || (r->garbage() > garbage_threshold)) {
|
||||
assert(!collection_set->is_in(r), "must not yet be in cset");
|
||||
collection_set->add_region(r);
|
||||
cur_cset = new_cset;
|
||||
cur_garbage = new_garbage;
|
||||
}
|
||||
}
|
||||
|
||||
// Step 2. Try to catch some recently allocated regions for evacuation ride.
|
||||
//
|
||||
// Pessimistically assume we are going to evacuate the entire region. While this
|
||||
// is very pessimistic and in most cases undershoots the collection set when regions
|
||||
// are mostly dead, it also provides more safety against running into allocation
|
||||
// failure when newly allocated regions are fully live.
|
||||
|
||||
for (size_t i = 0; i < cnt; i++) {
|
||||
if (data[i]._seqnum_last_alloc <= _last_cset_select) continue;
|
||||
|
||||
ShenandoahHeapRegion* r = data[i]._region;
|
||||
assert (r->is_regular(), "should have been filtered before");
|
||||
|
||||
// size_t new_garbage = cur_garbage + 0; (implied)
|
||||
size_t new_cset = cur_cset + r->used();
|
||||
|
||||
if (new_cset > max_cset) {
|
||||
break;
|
||||
}
|
||||
|
||||
assert(!collection_set->is_in(r), "must not yet be in cset");
|
||||
collection_set->add_region(r);
|
||||
cur_cset = new_cset;
|
||||
}
|
||||
|
||||
// Step 3. Clear liveness data
|
||||
// TODO: Merge it with step 0, but save live data in RegionData before.
|
||||
for (size_t i = 0; i < heap->num_regions(); i++) {
|
||||
ShenandoahHeapRegion* r = heap->get_region(i);
|
||||
if (r->used() > 0) {
|
||||
r->clear_live_data();
|
||||
}
|
||||
}
|
||||
|
||||
collection_set->update_region_status();
|
||||
|
||||
_last_cset_select = ShenandoahHeapRegion::seqnum_current_alloc();
|
||||
}
|
||||
|
||||
bool ShenandoahTraversalHeuristics::should_start_gc() const {
|
||||
ShenandoahHeap* heap = ShenandoahHeap::heap();
|
||||
assert(!heap->has_forwarded_objects(), "no forwarded objects here");
|
||||
|
||||
size_t capacity = heap->max_capacity();
|
||||
size_t available = heap->free_set()->available();
|
||||
|
||||
// Check if we are falling below the worst limit, time to trigger the GC, regardless of
|
||||
// anything else.
|
||||
size_t min_threshold = capacity / 100 * ShenandoahMinFreeThreshold;
|
||||
if (available < min_threshold) {
|
||||
log_info(gc)("Trigger: Free (" SIZE_FORMAT "%s) is below minimum threshold (" SIZE_FORMAT "%s)",
|
||||
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
|
||||
byte_size_in_proper_unit(min_threshold), proper_unit_for_byte_size(min_threshold));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if are need to learn a bit about the application
|
||||
const size_t max_learn = ShenandoahLearningSteps;
|
||||
if (_gc_times_learned < max_learn) {
|
||||
size_t init_threshold = capacity / 100 * ShenandoahInitFreeThreshold;
|
||||
if (available < init_threshold) {
|
||||
log_info(gc)("Trigger: Learning " SIZE_FORMAT " of " SIZE_FORMAT ". Free (" SIZE_FORMAT "%s) is below initial threshold (" SIZE_FORMAT "%s)",
|
||||
_gc_times_learned + 1, max_learn,
|
||||
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
|
||||
byte_size_in_proper_unit(init_threshold), proper_unit_for_byte_size(init_threshold));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if allocation headroom is still okay. This also factors in:
|
||||
// 1. Some space to absorb allocation spikes
|
||||
// 2. Accumulated penalties from Degenerated and Full GC
|
||||
|
||||
size_t allocation_headroom = available;
|
||||
|
||||
size_t spike_headroom = capacity / 100 * ShenandoahAllocSpikeFactor;
|
||||
size_t penalties = capacity / 100 * _gc_time_penalties;
|
||||
|
||||
allocation_headroom -= MIN2(allocation_headroom, spike_headroom);
|
||||
allocation_headroom -= MIN2(allocation_headroom, penalties);
|
||||
|
||||
double average_gc = _gc_time_history->avg();
|
||||
double time_since_last = time_since_last_gc();
|
||||
double allocation_rate = heap->bytes_allocated_since_gc_start() / time_since_last;
|
||||
|
||||
if (average_gc > allocation_headroom / allocation_rate) {
|
||||
log_info(gc)("Trigger: Average GC time (%.2f ms) is above the time for allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s)",
|
||||
average_gc * 1000,
|
||||
byte_size_in_proper_unit(allocation_rate), proper_unit_for_byte_size(allocation_rate),
|
||||
byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom));
|
||||
log_info(gc, ergo)("Free headroom: " SIZE_FORMAT "%s (free) - " SIZE_FORMAT "%s (spike) - " SIZE_FORMAT "%s (penalties) = " SIZE_FORMAT "%s",
|
||||
byte_size_in_proper_unit(available), proper_unit_for_byte_size(available),
|
||||
byte_size_in_proper_unit(spike_headroom), proper_unit_for_byte_size(spike_headroom),
|
||||
byte_size_in_proper_unit(penalties), proper_unit_for_byte_size(penalties),
|
||||
byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom));
|
||||
return true;
|
||||
} else if (ShenandoahHeuristics::should_start_gc()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ShenandoahTraversalHeuristics::choose_collection_set_from_regiondata(ShenandoahCollectionSet* set,
|
||||
RegionData* data, size_t data_size,
|
||||
size_t free) {
|
||||
ShouldNotReachHere();
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALHEURISTICS_HPP
|
||||
#define SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALHEURISTICS_HPP
|
||||
|
||||
#include "gc/shenandoah/shenandoahHeuristics.hpp"
|
||||
|
||||
class ShenandoahTraversalHeuristics : public ShenandoahHeuristics {
|
||||
private:
|
||||
uint64_t _last_cset_select;
|
||||
|
||||
protected:
|
||||
virtual void choose_collection_set_from_regiondata(ShenandoahCollectionSet* set,
|
||||
RegionData* data, size_t data_size,
|
||||
size_t free);
|
||||
|
||||
public:
|
||||
ShenandoahTraversalHeuristics();
|
||||
|
||||
virtual bool is_experimental();
|
||||
|
||||
virtual bool is_diagnostic();
|
||||
|
||||
virtual const char* name();
|
||||
|
||||
virtual void choose_collection_set(ShenandoahCollectionSet* collection_set);
|
||||
|
||||
virtual bool should_start_gc() const;
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_HEURISTICS_SHENANDOAHTRAVERSALHEURISTICS_HPP
|
@ -28,7 +28,6 @@
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "gc/shenandoah/shenandoahUtils.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
|
||||
@ -69,9 +68,6 @@ void ShenandoahAsserts::print_obj(ShenandoahMessageBuffer& msg, oop obj) {
|
||||
msg.append(" %3s allocated after mark start\n", ctx->allocated_after_mark_start((HeapWord *) obj) ? "" : "not");
|
||||
msg.append(" %3s marked \n", ctx->is_marked(obj) ? "" : "not");
|
||||
msg.append(" %3s in collection set\n", heap->in_collection_set(obj) ? "" : "not");
|
||||
if (heap->traversal_gc() != NULL) {
|
||||
msg.append(" %3s in traversal set\n", heap->traversal_gc()->traversal_set()->is_in(obj) ? "" : "not");
|
||||
}
|
||||
msg.append(" mark:%s\n", mw_ss.as_string());
|
||||
msg.append(" region: %s", ss.as_string());
|
||||
}
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "gc/shenandoah/shenandoahConcurrentRoots.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeuristics.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "memory/iterator.inline.hpp"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#ifdef COMPILER1
|
||||
@ -105,9 +104,8 @@ bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,Basic
|
||||
|
||||
bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
|
||||
bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0;
|
||||
bool is_traversal_mode = ShenandoahHeap::heap()->is_traversal_mode();
|
||||
bool on_weak_ref = (decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF)) != 0;
|
||||
return (on_weak_ref || unknown) && (keep_alive || is_traversal_mode);
|
||||
return (on_weak_ref || unknown) && keep_alive;
|
||||
}
|
||||
|
||||
oop ShenandoahBarrierSet::load_reference_barrier_not_null(oop obj) {
|
||||
@ -141,7 +139,7 @@ oop ShenandoahBarrierSet::load_reference_barrier_mutator_work(oop obj, T* load_a
|
||||
|
||||
oop fwd = resolve_forwarded_not_null_mutator(obj);
|
||||
if (obj == fwd) {
|
||||
assert(_heap->is_gc_in_progress_mask(ShenandoahHeap::EVACUATION | ShenandoahHeap::TRAVERSAL),
|
||||
assert(_heap->is_evacuation_in_progress(),
|
||||
"evac should be in progress");
|
||||
|
||||
ShenandoahEvacOOMScope scope;
|
||||
@ -159,7 +157,7 @@ oop ShenandoahBarrierSet::load_reference_barrier_mutator_work(oop obj, T* load_a
|
||||
oop ShenandoahBarrierSet::load_reference_barrier_impl(oop obj) {
|
||||
assert(ShenandoahLoadRefBarrier, "should be enabled");
|
||||
if (!CompressedOops::is_null(obj)) {
|
||||
bool evac_in_progress = _heap->is_gc_in_progress_mask(ShenandoahHeap::EVACUATION | ShenandoahHeap::TRAVERSAL);
|
||||
bool evac_in_progress = _heap->is_evacuation_in_progress();
|
||||
oop fwd = resolve_forwarded_not_null(obj);
|
||||
if (evac_in_progress &&
|
||||
_heap->in_collection_set(obj) &&
|
||||
|
@ -53,7 +53,6 @@ inline oop ShenandoahBarrierSet::resolve_forwarded_not_null_mutator(oop p) {
|
||||
}
|
||||
|
||||
inline void ShenandoahBarrierSet::enqueue(oop obj) {
|
||||
shenandoah_assert_not_forwarded_if(NULL, obj, _heap->is_concurrent_traversal_in_progress());
|
||||
assert(_satb_mark_queue_set.is_active(), "only get here when SATB active");
|
||||
|
||||
// Filter marked objects before hitting the SATB queues. The same predicate would
|
||||
@ -86,7 +85,7 @@ inline void ShenandoahBarrierSet::satb_enqueue(oop value) {
|
||||
}
|
||||
|
||||
inline void ShenandoahBarrierSet::storeval_barrier(oop obj) {
|
||||
if (obj != NULL && ShenandoahStoreValEnqueueBarrier && _heap->is_concurrent_traversal_in_progress()) {
|
||||
if (obj != NULL && ShenandoahStoreValEnqueueBarrier) {
|
||||
enqueue(obj);
|
||||
}
|
||||
}
|
||||
@ -321,9 +320,6 @@ void ShenandoahBarrierSet::arraycopy_update_impl(T* src, size_t count) {
|
||||
if (_heap->is_evacuation_in_progress()) {
|
||||
ShenandoahEvacOOMScope oom_evac;
|
||||
arraycopy_work<T, true, true, false>(src, count);
|
||||
} else if (_heap->is_concurrent_traversal_in_progress()){
|
||||
ShenandoahEvacOOMScope oom_evac;
|
||||
arraycopy_work<T, true, true, true>(src, count);
|
||||
} else if (_heap->has_forwarded_objects()) {
|
||||
arraycopy_work<T, true, false, false>(src, count);
|
||||
}
|
||||
|
@ -86,10 +86,6 @@ void ShenandoahBarrierSet::clone_barrier(oop obj) {
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ false> cl;
|
||||
obj->oop_iterate(&cl);
|
||||
} else if (_heap->is_concurrent_traversal_in_progress()) {
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
ShenandoahUpdateRefsForOopClosure</* evac = */ true, /* enqueue */ true> cl;
|
||||
obj->oop_iterate(&cl);
|
||||
} else {
|
||||
ShenandoahUpdateRefsForOopClosure</* evac = */ false, /* enqueue */ false> cl;
|
||||
obj->oop_iterate(&cl);
|
||||
|
@ -66,20 +66,6 @@ private:
|
||||
inline void do_oop_work(T* p);
|
||||
};
|
||||
|
||||
class ShenandoahTraversalUpdateRefsClosure: public OopClosure {
|
||||
private:
|
||||
ShenandoahHeap* const _heap;
|
||||
ShenandoahHeapRegionSet* const _traversal_set;
|
||||
|
||||
public:
|
||||
inline ShenandoahTraversalUpdateRefsClosure();
|
||||
inline void do_oop(oop* p);
|
||||
inline void do_oop(narrowOop* p);
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p);
|
||||
};
|
||||
|
||||
class ShenandoahEvacuateUpdateRootsClosure: public BasicOopIterateClosure {
|
||||
private:
|
||||
ShenandoahHeap* _heap;
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "gc/shenandoah/shenandoahClosures.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahNMethod.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "oops/compressedOops.inline.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
@ -42,9 +41,7 @@ bool ShenandoahForwardedIsAliveClosure::do_object_b(oop obj) {
|
||||
return false;
|
||||
}
|
||||
obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
|
||||
shenandoah_assert_not_forwarded_if(NULL, obj,
|
||||
(ShenandoahHeap::heap()->is_concurrent_mark_in_progress() ||
|
||||
ShenandoahHeap::heap()->is_concurrent_traversal_in_progress()));
|
||||
shenandoah_assert_not_forwarded_if(NULL, obj, ShenandoahHeap::heap()->is_concurrent_mark_in_progress());
|
||||
return _mark_context->is_marked(obj);
|
||||
}
|
||||
|
||||
@ -82,29 +79,6 @@ void ShenandoahUpdateRefsClosure::do_oop_work(T* p) {
|
||||
void ShenandoahUpdateRefsClosure::do_oop(oop* p) { do_oop_work(p); }
|
||||
void ShenandoahUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
|
||||
ShenandoahTraversalUpdateRefsClosure::ShenandoahTraversalUpdateRefsClosure() :
|
||||
_heap(ShenandoahHeap::heap()),
|
||||
_traversal_set(ShenandoahHeap::heap()->traversal_gc()->traversal_set()) {
|
||||
assert(_heap->is_traversal_mode(), "Why we here?");
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void ShenandoahTraversalUpdateRefsClosure::do_oop_work(T* p) {
|
||||
T o = RawAccess<>::oop_load(p);
|
||||
if (!CompressedOops::is_null(o)) {
|
||||
oop obj = CompressedOops::decode_not_null(o);
|
||||
if (_heap->in_collection_set(obj) || _traversal_set->is_in(obj)) {
|
||||
obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
|
||||
RawAccess<IS_NOT_NULL>::oop_store(p, obj);
|
||||
} else {
|
||||
shenandoah_assert_not_forwarded(p, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahTraversalUpdateRefsClosure::do_oop(oop* p) { do_oop_work(p); }
|
||||
void ShenandoahTraversalUpdateRefsClosure::do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
|
||||
ShenandoahEvacuateUpdateRootsClosure::ShenandoahEvacuateUpdateRootsClosure() :
|
||||
_heap(ShenandoahHeap::heap()), _thread(Thread::current()) {
|
||||
}
|
||||
|
@ -32,7 +32,6 @@
|
||||
class ShenandoahStrDedupQueue;
|
||||
|
||||
class ShenandoahConcurrentMark: public CHeapObj<mtGC> {
|
||||
friend class ShenandoahTraversalGC;
|
||||
private:
|
||||
ShenandoahHeap* _heap;
|
||||
ShenandoahObjToScanQueueSet* _task_queues;
|
||||
|
@ -39,7 +39,7 @@ template <class T>
|
||||
void ShenandoahConcurrentMark::do_task(ShenandoahObjToScanQueue* q, T* cl, jushort* live_data, ShenandoahMarkTask* task) {
|
||||
oop obj = task->obj();
|
||||
|
||||
shenandoah_assert_not_forwarded_except(NULL, obj, _heap->is_concurrent_traversal_in_progress() && _heap->cancelled_gc());
|
||||
shenandoah_assert_not_forwarded(NULL, obj);
|
||||
shenandoah_assert_marked(NULL, obj);
|
||||
shenandoah_assert_not_in_cset_except(NULL, obj, _heap->cancelled_gc());
|
||||
|
||||
|
@ -27,8 +27,7 @@
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
|
||||
bool ShenandoahConcurrentRoots::can_do_concurrent_roots() {
|
||||
// Don't support traversal GC at this moment
|
||||
return !ShenandoahHeap::heap()->is_traversal_mode();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ShenandoahConcurrentRoots::should_do_concurrent_roots() {
|
||||
@ -39,8 +38,7 @@ bool ShenandoahConcurrentRoots::should_do_concurrent_roots() {
|
||||
bool ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() {
|
||||
#if defined(X86) && !defined(SOLARIS)
|
||||
return ShenandoahCodeRootsStyle == 2 &&
|
||||
ClassUnloading &&
|
||||
strcmp(ShenandoahGCMode, "traversal") != 0;
|
||||
ClassUnloading;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "gc/shenandoah/shenandoahHeuristics.hpp"
|
||||
#include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
|
||||
#include "gc/shenandoah/shenandoahControlThread.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "gc/shenandoah/shenandoahUtils.hpp"
|
||||
#include "gc/shenandoah/shenandoahVMOperations.hpp"
|
||||
#include "gc/shenandoah/shenandoahWorkerPolicy.hpp"
|
||||
@ -69,10 +68,8 @@ void ShenandoahPeriodicSATBFlushTask::task() {
|
||||
void ShenandoahControlThread::run_service() {
|
||||
ShenandoahHeap* heap = ShenandoahHeap::heap();
|
||||
|
||||
GCMode default_mode = heap->is_traversal_mode() ?
|
||||
concurrent_traversal : concurrent_normal;
|
||||
GCCause::Cause default_cause = heap->is_traversal_mode() ?
|
||||
GCCause::_shenandoah_traversal_gc : GCCause::_shenandoah_concurrent_gc;
|
||||
GCMode default_mode = concurrent_normal;
|
||||
GCCause::Cause default_cause = GCCause::_shenandoah_concurrent_gc;
|
||||
int sleep = ShenandoahControlIntervalMin;
|
||||
|
||||
double last_shrink_time = os::elapsedTime();
|
||||
@ -191,9 +188,6 @@ void ShenandoahControlThread::run_service() {
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case concurrent_traversal:
|
||||
service_concurrent_traversal_cycle(cause);
|
||||
break;
|
||||
case concurrent_normal:
|
||||
service_concurrent_normal_cycle(cause);
|
||||
break;
|
||||
@ -286,31 +280,6 @@ void ShenandoahControlThread::run_service() {
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahControlThread::service_concurrent_traversal_cycle(GCCause::Cause cause) {
|
||||
GCIdMark gc_id_mark;
|
||||
ShenandoahGCSession session(cause);
|
||||
|
||||
ShenandoahHeap* heap = ShenandoahHeap::heap();
|
||||
TraceCollectorStats tcs(heap->monitoring_support()->concurrent_collection_counters());
|
||||
|
||||
// Reset for upcoming cycle
|
||||
heap->entry_reset();
|
||||
|
||||
heap->vmop_entry_init_traversal();
|
||||
|
||||
if (check_cancellation_or_degen(ShenandoahHeap::_degenerated_traversal)) return;
|
||||
|
||||
heap->entry_traversal();
|
||||
if (check_cancellation_or_degen(ShenandoahHeap::_degenerated_traversal)) return;
|
||||
|
||||
heap->vmop_entry_final_traversal();
|
||||
|
||||
heap->entry_cleanup();
|
||||
|
||||
heap->heuristics()->record_success_concurrent();
|
||||
heap->shenandoah_policy()->record_success_concurrent();
|
||||
}
|
||||
|
||||
void ShenandoahControlThread::service_concurrent_normal_cycle(GCCause::Cause cause) {
|
||||
// Normal cycle goes via all concurrent phases. If allocation failure (af) happens during
|
||||
// any of the concurrent phases, it first degrades to Degenerated GC and completes GC there.
|
||||
|
@ -57,7 +57,6 @@ class ShenandoahControlThread: public ConcurrentGCThread {
|
||||
private:
|
||||
typedef enum {
|
||||
none,
|
||||
concurrent_traversal,
|
||||
concurrent_normal,
|
||||
stw_degenerated,
|
||||
stw_full
|
||||
@ -93,7 +92,6 @@ private:
|
||||
void service_concurrent_normal_cycle(GCCause::Cause cause);
|
||||
void service_stw_full_cycle(GCCause::Cause cause);
|
||||
void service_stw_degenerated_cycle(GCCause::Cause cause, ShenandoahHeap::ShenandoahDegenPoint point);
|
||||
void service_concurrent_traversal_cycle(GCCause::Cause cause);
|
||||
void service_uncommit(double shrink_before);
|
||||
|
||||
bool try_set_alloc_failure_gc();
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
|
||||
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "logging/logStream.hpp"
|
||||
#include "runtime/orderAccess.hpp"
|
||||
|
||||
@ -178,9 +177,6 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah
|
||||
// Allocation successful, bump stats:
|
||||
if (req.is_mutator_alloc()) {
|
||||
increase_used(size * HeapWordSize);
|
||||
if (_heap->is_traversal_mode()) {
|
||||
r->update_seqnum_last_alloc_mutator();
|
||||
}
|
||||
}
|
||||
|
||||
// Record actual allocation size
|
||||
@ -188,14 +184,6 @@ HeapWord* ShenandoahFreeSet::try_allocate_in(ShenandoahHeapRegion* r, Shenandoah
|
||||
|
||||
if (req.is_gc_alloc()) {
|
||||
r->set_update_watermark(r->top());
|
||||
if (_heap->is_concurrent_traversal_in_progress()) {
|
||||
// Traversal needs to traverse through GC allocs. Adjust TAMS to the new top
|
||||
// so that these allocations appear below TAMS, and thus get traversed.
|
||||
// See top of shenandoahTraversal.cpp for an explanation.
|
||||
_heap->marking_context()->capture_top_at_mark_start(r);
|
||||
_heap->traversal_gc()->traversal_set()->add_region_check_for_duplicates(r);
|
||||
OrderAccess::fence();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,6 @@
|
||||
#include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahStringDedup.hpp"
|
||||
#include "gc/shenandoah/shenandoahTaskqueue.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalMode.hpp"
|
||||
#include "gc/shenandoah/shenandoahUtils.hpp"
|
||||
#include "gc/shenandoah/shenandoahVerifier.hpp"
|
||||
#include "gc/shenandoah/shenandoahCodeRoots.hpp"
|
||||
@ -379,10 +378,6 @@ jint ShenandoahHeap::initialize() {
|
||||
_pacer = NULL;
|
||||
}
|
||||
|
||||
_traversal_gc = strcmp(ShenandoahGCMode, "traversal") == 0 ?
|
||||
new ShenandoahTraversalGC(this, _num_regions) :
|
||||
NULL;
|
||||
|
||||
_control_thread = new ShenandoahControlThread();
|
||||
|
||||
log_info(gc, init)("Initialize Shenandoah heap: " SIZE_FORMAT "%s initial, " SIZE_FORMAT "%s min, " SIZE_FORMAT "%s max",
|
||||
@ -400,9 +395,7 @@ jint ShenandoahHeap::initialize() {
|
||||
|
||||
void ShenandoahHeap::initialize_heuristics() {
|
||||
if (ShenandoahGCMode != NULL) {
|
||||
if (strcmp(ShenandoahGCMode, "traversal") == 0) {
|
||||
_gc_mode = new ShenandoahTraversalMode();
|
||||
} else if (strcmp(ShenandoahGCMode, "normal") == 0) {
|
||||
if (strcmp(ShenandoahGCMode, "normal") == 0) {
|
||||
_gc_mode = new ShenandoahNormalMode();
|
||||
} else if (strcmp(ShenandoahGCMode, "passive") == 0) {
|
||||
_gc_mode = new ShenandoahPassiveMode();
|
||||
@ -452,7 +445,6 @@ ShenandoahHeap::ShenandoahHeap(ShenandoahCollectorPolicy* policy) :
|
||||
_heuristics(NULL),
|
||||
_free_set(NULL),
|
||||
_scm(new ShenandoahConcurrentMark()),
|
||||
_traversal_gc(NULL),
|
||||
_full_gc(new ShenandoahMarkCompact()),
|
||||
_pacer(NULL),
|
||||
_verifier(NULL),
|
||||
@ -549,7 +541,6 @@ void ShenandoahHeap::print_on(outputStream* st) const {
|
||||
if (is_concurrent_mark_in_progress()) st->print("marking, ");
|
||||
if (is_evacuation_in_progress()) st->print("evacuating, ");
|
||||
if (is_update_refs_in_progress()) st->print("updating refs, ");
|
||||
if (is_concurrent_traversal_in_progress()) st->print("traversal, ");
|
||||
if (is_degenerated_gc_in_progress()) st->print("degenerated gc, ");
|
||||
if (is_full_gc_in_progress()) st->print("full gc, ");
|
||||
if (is_full_gc_move_in_progress()) st->print("full gc move, ");
|
||||
@ -1664,18 +1655,6 @@ void ShenandoahHeap::op_preclean() {
|
||||
concurrent_mark()->preclean_weak_refs();
|
||||
}
|
||||
|
||||
void ShenandoahHeap::op_init_traversal() {
|
||||
traversal_gc()->init_traversal_collection();
|
||||
}
|
||||
|
||||
void ShenandoahHeap::op_traversal() {
|
||||
traversal_gc()->concurrent_traversal_collection();
|
||||
}
|
||||
|
||||
void ShenandoahHeap::op_final_traversal() {
|
||||
traversal_gc()->final_traversal_collection();
|
||||
}
|
||||
|
||||
void ShenandoahHeap::op_full(GCCause::Cause cause) {
|
||||
ShenandoahMetricsSnapshot metrics;
|
||||
metrics.snap_before();
|
||||
@ -1708,24 +1687,6 @@ void ShenandoahHeap::op_degenerated(ShenandoahDegenPoint point) {
|
||||
metrics.snap_before();
|
||||
|
||||
switch (point) {
|
||||
case _degenerated_traversal:
|
||||
{
|
||||
// Drop the collection set. Note: this leaves some already forwarded objects
|
||||
// behind, which may be problematic, see comments for ShenandoahEvacAssist
|
||||
// workarounds in ShenandoahTraversalHeuristics.
|
||||
|
||||
ShenandoahHeapLocker locker(lock());
|
||||
collection_set()->clear_current_index();
|
||||
for (size_t i = 0; i < collection_set()->count(); i++) {
|
||||
ShenandoahHeapRegion* r = collection_set()->next();
|
||||
r->make_regular_bypass();
|
||||
}
|
||||
collection_set()->clear();
|
||||
}
|
||||
op_final_traversal();
|
||||
op_cleanup();
|
||||
return;
|
||||
|
||||
// The cases below form the Duff's-like device: it describes the actual GC cycle,
|
||||
// but enters it at different points, depending on which concurrent phase had
|
||||
// degenerated.
|
||||
@ -1742,13 +1703,6 @@ void ShenandoahHeap::op_degenerated(ShenandoahDegenPoint point) {
|
||||
set_process_references(heuristics()->can_process_references());
|
||||
set_unload_classes(heuristics()->can_unload_classes());
|
||||
|
||||
if (is_traversal_mode()) {
|
||||
// Not possible to degenerate from here, upgrade to Full GC right away.
|
||||
cancel_gc(GCCause::_shenandoah_upgrade_to_full_gc);
|
||||
op_degenerated_fail();
|
||||
return;
|
||||
}
|
||||
|
||||
op_reset();
|
||||
|
||||
op_init_mark();
|
||||
@ -1874,7 +1828,7 @@ void ShenandoahHeap::op_degenerated_futile() {
|
||||
}
|
||||
|
||||
void ShenandoahHeap::force_satb_flush_all_threads() {
|
||||
if (!is_concurrent_mark_in_progress() && !is_concurrent_traversal_in_progress()) {
|
||||
if (!is_concurrent_mark_in_progress()) {
|
||||
// No need to flush SATBs
|
||||
return;
|
||||
}
|
||||
@ -1908,11 +1862,6 @@ void ShenandoahHeap::set_concurrent_mark_in_progress(bool in_progress) {
|
||||
ShenandoahBarrierSet::satb_mark_queue_set().set_active_all_threads(in_progress, !in_progress);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::set_concurrent_traversal_in_progress(bool in_progress) {
|
||||
set_gc_state_mask(TRAVERSAL, in_progress);
|
||||
ShenandoahBarrierSet::satb_mark_queue_set().set_active_all_threads(in_progress, !in_progress);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::set_evacuation_in_progress(bool in_progress) {
|
||||
assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Only call this at safepoint");
|
||||
set_gc_state_mask(EVACUATION, in_progress);
|
||||
@ -2051,19 +2000,11 @@ void ShenandoahHeap::stw_process_weak_roots(bool full_gc) {
|
||||
|
||||
// Cleanup weak roots
|
||||
if (has_forwarded_objects()) {
|
||||
if (is_traversal_mode()) {
|
||||
ShenandoahForwardedIsAliveClosure is_alive;
|
||||
ShenandoahTraversalUpdateRefsClosure keep_alive;
|
||||
ShenandoahParallelWeakRootsCleaningTask<ShenandoahForwardedIsAliveClosure, ShenandoahTraversalUpdateRefsClosure>
|
||||
cleaning_task(&is_alive, &keep_alive, num_workers);
|
||||
_workers->run_task(&cleaning_task);
|
||||
} else {
|
||||
ShenandoahForwardedIsAliveClosure is_alive;
|
||||
ShenandoahUpdateRefsClosure keep_alive;
|
||||
ShenandoahParallelWeakRootsCleaningTask<ShenandoahForwardedIsAliveClosure, ShenandoahUpdateRefsClosure>
|
||||
cleaning_task(&is_alive, &keep_alive, num_workers);
|
||||
_workers->run_task(&cleaning_task);
|
||||
}
|
||||
} else {
|
||||
ShenandoahIsAliveClosure is_alive;
|
||||
#ifdef ASSERT
|
||||
@ -2087,14 +2028,9 @@ void ShenandoahHeap::parallel_cleaning(bool full_gc) {
|
||||
}
|
||||
|
||||
void ShenandoahHeap::set_has_forwarded_objects(bool cond) {
|
||||
if (is_traversal_mode()) {
|
||||
set_gc_state_mask(HAS_FORWARDED | UPDATEREFS, cond);
|
||||
} else {
|
||||
set_gc_state_mask(HAS_FORWARDED, cond);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ShenandoahHeap::set_process_references(bool pr) {
|
||||
_process_references.set_cond(pr);
|
||||
}
|
||||
@ -2529,26 +2465,6 @@ void ShenandoahHeap::vmop_entry_final_updaterefs() {
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::vmop_entry_init_traversal() {
|
||||
TraceCollectorStats tcs(monitoring_support()->stw_collection_counters());
|
||||
ShenandoahGCPhase total(ShenandoahPhaseTimings::total_pause_gross);
|
||||
ShenandoahGCPhase phase(ShenandoahPhaseTimings::init_traversal_gc_gross);
|
||||
|
||||
try_inject_alloc_failure();
|
||||
VM_ShenandoahInitTraversalGC op;
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::vmop_entry_final_traversal() {
|
||||
TraceCollectorStats tcs(monitoring_support()->stw_collection_counters());
|
||||
ShenandoahGCPhase total(ShenandoahPhaseTimings::total_pause_gross);
|
||||
ShenandoahGCPhase phase(ShenandoahPhaseTimings::final_traversal_gc_gross);
|
||||
|
||||
try_inject_alloc_failure();
|
||||
VM_ShenandoahFinalTraversalGC op;
|
||||
VMThread::execute(&op);
|
||||
}
|
||||
|
||||
void ShenandoahHeap::vmop_entry_full(GCCause::Cause cause) {
|
||||
TraceCollectorStats tcs(monitoring_support()->full_stw_collection_counters());
|
||||
ShenandoahGCPhase total(ShenandoahPhaseTimings::total_pause_gross);
|
||||
@ -2624,36 +2540,6 @@ void ShenandoahHeap::entry_final_updaterefs() {
|
||||
op_final_updaterefs();
|
||||
}
|
||||
|
||||
void ShenandoahHeap::entry_init_traversal() {
|
||||
ShenandoahGCPhase total_phase(ShenandoahPhaseTimings::total_pause);
|
||||
ShenandoahGCPhase phase(ShenandoahPhaseTimings::init_traversal_gc);
|
||||
|
||||
static const char* msg = init_traversal_event_message();
|
||||
GCTraceTime(Info, gc) time(msg, gc_timer());
|
||||
EventMark em("%s", msg);
|
||||
|
||||
ShenandoahWorkerScope scope(workers(),
|
||||
ShenandoahWorkerPolicy::calc_workers_for_stw_traversal(),
|
||||
"init traversal");
|
||||
|
||||
op_init_traversal();
|
||||
}
|
||||
|
||||
void ShenandoahHeap::entry_final_traversal() {
|
||||
ShenandoahGCPhase total_phase(ShenandoahPhaseTimings::total_pause);
|
||||
ShenandoahGCPhase phase(ShenandoahPhaseTimings::final_traversal_gc);
|
||||
|
||||
static const char* msg = final_traversal_event_message();
|
||||
GCTraceTime(Info, gc) time(msg, gc_timer());
|
||||
EventMark em("%s", msg);
|
||||
|
||||
ShenandoahWorkerScope scope(workers(),
|
||||
ShenandoahWorkerPolicy::calc_workers_for_stw_traversal(),
|
||||
"final traversal");
|
||||
|
||||
op_final_traversal();
|
||||
}
|
||||
|
||||
void ShenandoahHeap::entry_full(GCCause::Cause cause) {
|
||||
ShenandoahGCPhase total_phase(ShenandoahPhaseTimings::total_pause);
|
||||
ShenandoahGCPhase phase(ShenandoahPhaseTimings::full_gc);
|
||||
@ -2794,21 +2680,6 @@ void ShenandoahHeap::entry_preclean() {
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahHeap::entry_traversal() {
|
||||
static const char* msg = conc_traversal_event_message();
|
||||
GCTraceTime(Info, gc) time(msg);
|
||||
EventMark em("%s", msg);
|
||||
|
||||
TraceCollectorStats tcs(monitoring_support()->concurrent_collection_counters());
|
||||
|
||||
ShenandoahWorkerScope scope(workers(),
|
||||
ShenandoahWorkerPolicy::calc_workers_for_conc_traversal(),
|
||||
"concurrent traversal");
|
||||
|
||||
try_inject_alloc_failure();
|
||||
op_traversal();
|
||||
}
|
||||
|
||||
void ShenandoahHeap::entry_uncommit(double shrink_before) {
|
||||
static const char *msg = "Concurrent uncommit";
|
||||
GCTraceTime(Info, gc) time(msg, NULL, GCCause::_no_gc, true);
|
||||
@ -2943,57 +2814,10 @@ const char* ShenandoahHeap::conc_mark_event_message() const {
|
||||
}
|
||||
}
|
||||
|
||||
const char* ShenandoahHeap::init_traversal_event_message() const {
|
||||
bool proc_refs = process_references();
|
||||
bool unload_cls = unload_classes();
|
||||
|
||||
if (proc_refs && unload_cls) {
|
||||
return "Pause Init Traversal (process weakrefs) (unload classes)";
|
||||
} else if (proc_refs) {
|
||||
return "Pause Init Traversal (process weakrefs)";
|
||||
} else if (unload_cls) {
|
||||
return "Pause Init Traversal (unload classes)";
|
||||
} else {
|
||||
return "Pause Init Traversal";
|
||||
}
|
||||
}
|
||||
|
||||
const char* ShenandoahHeap::final_traversal_event_message() const {
|
||||
bool proc_refs = process_references();
|
||||
bool unload_cls = unload_classes();
|
||||
|
||||
if (proc_refs && unload_cls) {
|
||||
return "Pause Final Traversal (process weakrefs) (unload classes)";
|
||||
} else if (proc_refs) {
|
||||
return "Pause Final Traversal (process weakrefs)";
|
||||
} else if (unload_cls) {
|
||||
return "Pause Final Traversal (unload classes)";
|
||||
} else {
|
||||
return "Pause Final Traversal";
|
||||
}
|
||||
}
|
||||
|
||||
const char* ShenandoahHeap::conc_traversal_event_message() const {
|
||||
bool proc_refs = process_references();
|
||||
bool unload_cls = unload_classes();
|
||||
|
||||
if (proc_refs && unload_cls) {
|
||||
return "Concurrent Traversal (process weakrefs) (unload classes)";
|
||||
} else if (proc_refs) {
|
||||
return "Concurrent Traversal (process weakrefs)";
|
||||
} else if (unload_cls) {
|
||||
return "Concurrent Traversal (unload classes)";
|
||||
} else {
|
||||
return "Concurrent Traversal";
|
||||
}
|
||||
}
|
||||
|
||||
const char* ShenandoahHeap::degen_event_message(ShenandoahDegenPoint point) const {
|
||||
switch (point) {
|
||||
case _degenerated_unset:
|
||||
return "Pause Degenerated GC (<UNSET>)";
|
||||
case _degenerated_traversal:
|
||||
return "Pause Degenerated GC (Traversal)";
|
||||
case _degenerated_outside_cycle:
|
||||
return "Pause Degenerated GC (Outside of Cycle)";
|
||||
case _degenerated_mark:
|
||||
|
@ -57,7 +57,6 @@ class ShenandoahConcurrentMark;
|
||||
class ShenandoahMarkCompact;
|
||||
class ShenandoahMonitoringSupport;
|
||||
class ShenandoahPacer;
|
||||
class ShenandoahTraversalGC;
|
||||
class ShenandoahVerifier;
|
||||
class ShenandoahWorkGang;
|
||||
class VMStructs;
|
||||
@ -250,9 +249,6 @@ public:
|
||||
|
||||
// Heap is under updating: needs no additional barriers.
|
||||
UPDATEREFS_BITPOS = 3,
|
||||
|
||||
// Heap is under traversal collection
|
||||
TRAVERSAL_BITPOS = 4
|
||||
};
|
||||
|
||||
enum GCState {
|
||||
@ -261,7 +257,6 @@ public:
|
||||
MARKING = 1 << MARKING_BITPOS,
|
||||
EVACUATION = 1 << EVACUATION_BITPOS,
|
||||
UPDATEREFS = 1 << UPDATEREFS_BITPOS,
|
||||
TRAVERSAL = 1 << TRAVERSAL_BITPOS
|
||||
};
|
||||
|
||||
private:
|
||||
@ -285,7 +280,6 @@ public:
|
||||
void set_degenerated_gc_in_progress(bool in_progress);
|
||||
void set_full_gc_in_progress(bool in_progress);
|
||||
void set_full_gc_move_in_progress(bool in_progress);
|
||||
void set_concurrent_traversal_in_progress(bool in_progress);
|
||||
void set_has_forwarded_objects(bool cond);
|
||||
void set_concurrent_root_in_progress(bool cond);
|
||||
|
||||
@ -297,7 +291,6 @@ public:
|
||||
inline bool is_degenerated_gc_in_progress() const;
|
||||
inline bool is_full_gc_in_progress() const;
|
||||
inline bool is_full_gc_move_in_progress() const;
|
||||
inline bool is_concurrent_traversal_in_progress() const;
|
||||
inline bool has_forwarded_objects() const;
|
||||
inline bool is_gc_in_progress_mask(uint mask) const;
|
||||
inline bool is_stw_gc_in_progress() const;
|
||||
@ -310,7 +303,6 @@ public:
|
||||
public:
|
||||
enum ShenandoahDegenPoint {
|
||||
_degenerated_unset,
|
||||
_degenerated_traversal,
|
||||
_degenerated_outside_cycle,
|
||||
_degenerated_mark,
|
||||
_degenerated_evac,
|
||||
@ -322,8 +314,6 @@ public:
|
||||
switch (point) {
|
||||
case _degenerated_unset:
|
||||
return "<UNSET>";
|
||||
case _degenerated_traversal:
|
||||
return "Traversal";
|
||||
case _degenerated_outside_cycle:
|
||||
return "Outside of Cycle";
|
||||
case _degenerated_mark:
|
||||
@ -376,8 +366,6 @@ public:
|
||||
void vmop_entry_final_mark();
|
||||
void vmop_entry_init_updaterefs();
|
||||
void vmop_entry_final_updaterefs();
|
||||
void vmop_entry_init_traversal();
|
||||
void vmop_entry_final_traversal();
|
||||
void vmop_entry_full(GCCause::Cause cause);
|
||||
void vmop_degenerated(ShenandoahDegenPoint point);
|
||||
|
||||
@ -387,8 +375,6 @@ public:
|
||||
void entry_final_mark();
|
||||
void entry_init_updaterefs();
|
||||
void entry_final_updaterefs();
|
||||
void entry_init_traversal();
|
||||
void entry_final_traversal();
|
||||
void entry_full(GCCause::Cause cause);
|
||||
void entry_degenerated(int point);
|
||||
|
||||
@ -401,7 +387,6 @@ public:
|
||||
void entry_cleanup();
|
||||
void entry_evac();
|
||||
void entry_updaterefs();
|
||||
void entry_traversal();
|
||||
void entry_uncommit(double shrink_before);
|
||||
|
||||
private:
|
||||
@ -410,8 +395,6 @@ private:
|
||||
void op_final_mark();
|
||||
void op_init_updaterefs();
|
||||
void op_final_updaterefs();
|
||||
void op_init_traversal();
|
||||
void op_final_traversal();
|
||||
void op_full(GCCause::Cause cause);
|
||||
void op_degenerated(ShenandoahDegenPoint point);
|
||||
void op_degenerated_fail();
|
||||
@ -425,7 +408,6 @@ private:
|
||||
void op_conc_evac();
|
||||
void op_stw_evac();
|
||||
void op_updaterefs();
|
||||
void op_traversal();
|
||||
void op_uncommit(double shrink_before);
|
||||
|
||||
// Messages for GC trace events, they have to be immortal for
|
||||
@ -433,9 +415,6 @@ private:
|
||||
const char* init_mark_event_message() const;
|
||||
const char* final_mark_event_message() const;
|
||||
const char* conc_mark_event_message() const;
|
||||
const char* init_traversal_event_message() const;
|
||||
const char* final_traversal_event_message() const;
|
||||
const char* conc_traversal_event_message() const;
|
||||
const char* degen_event_message(ShenandoahDegenPoint point) const;
|
||||
|
||||
// ---------- GC subsystems
|
||||
@ -447,7 +426,6 @@ private:
|
||||
ShenandoahHeuristics* _heuristics;
|
||||
ShenandoahFreeSet* _free_set;
|
||||
ShenandoahConcurrentMark* _scm;
|
||||
ShenandoahTraversalGC* _traversal_gc;
|
||||
ShenandoahMarkCompact* _full_gc;
|
||||
ShenandoahPacer* _pacer;
|
||||
ShenandoahVerifier* _verifier;
|
||||
@ -462,8 +440,6 @@ public:
|
||||
ShenandoahHeuristics* heuristics() const { return _heuristics; }
|
||||
ShenandoahFreeSet* free_set() const { return _free_set; }
|
||||
ShenandoahConcurrentMark* concurrent_mark() { return _scm; }
|
||||
ShenandoahTraversalGC* traversal_gc() const { return _traversal_gc; }
|
||||
bool is_traversal_mode() const { return _traversal_gc != NULL; }
|
||||
ShenandoahPacer* pacer() const { return _pacer; }
|
||||
|
||||
ShenandoahPhaseTimings* phase_timings() const { return _phase_timings; }
|
||||
|
@ -251,7 +251,6 @@ inline oop ShenandoahHeap::evacuate_object(oop p, Thread* thread) {
|
||||
}
|
||||
|
||||
assert(ShenandoahThreadLocalData::is_evac_allowed(thread), "must be enclosed in oom-evac scope");
|
||||
assert(is_concurrent_traversal_in_progress() || !is_traversal_mode(), "Should not evacuate objects");
|
||||
|
||||
size_t size = p->size();
|
||||
|
||||
@ -343,17 +342,13 @@ inline bool ShenandoahHeap::is_stable() const {
|
||||
}
|
||||
|
||||
inline bool ShenandoahHeap::is_idle() const {
|
||||
return _gc_state.is_unset(MARKING | EVACUATION | UPDATEREFS | TRAVERSAL);
|
||||
return _gc_state.is_unset(MARKING | EVACUATION | UPDATEREFS);
|
||||
}
|
||||
|
||||
inline bool ShenandoahHeap::is_concurrent_mark_in_progress() const {
|
||||
return _gc_state.is_set(MARKING);
|
||||
}
|
||||
|
||||
inline bool ShenandoahHeap::is_concurrent_traversal_in_progress() const {
|
||||
return _gc_state.is_set(TRAVERSAL);
|
||||
}
|
||||
|
||||
inline bool ShenandoahHeap::is_evacuation_in_progress() const {
|
||||
return _gc_state.is_set(EVACUATION);
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
|
||||
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "gc/shared/space.inline.hpp"
|
||||
#include "jfr/jfrEvents.hpp"
|
||||
#include "memory/iterator.inline.hpp"
|
||||
@ -52,8 +51,6 @@ size_t ShenandoahHeapRegion::HumongousThresholdWords = 0;
|
||||
size_t ShenandoahHeapRegion::MaxTLABSizeBytes = 0;
|
||||
size_t ShenandoahHeapRegion::MaxTLABSizeWords = 0;
|
||||
|
||||
ShenandoahHeapRegion::PaddedAllocSeqNum ShenandoahHeapRegion::_alloc_seq_num;
|
||||
|
||||
ShenandoahHeapRegion::ShenandoahHeapRegion(HeapWord* start, size_t index, bool committed) :
|
||||
_index(index),
|
||||
_bottom(start),
|
||||
@ -64,7 +61,6 @@ ShenandoahHeapRegion::ShenandoahHeapRegion(HeapWord* start, size_t index, bool c
|
||||
_top(start),
|
||||
_tlab_allocs(0),
|
||||
_gclab_allocs(0),
|
||||
_seqnum_last_alloc_mutator(0),
|
||||
_live_data(0),
|
||||
_critical_pins(0),
|
||||
_update_watermark(start) {
|
||||
@ -309,27 +305,17 @@ void ShenandoahHeapRegion::clear_live_data() {
|
||||
void ShenandoahHeapRegion::reset_alloc_metadata() {
|
||||
_tlab_allocs = 0;
|
||||
_gclab_allocs = 0;
|
||||
_seqnum_last_alloc_mutator = 0;
|
||||
}
|
||||
|
||||
void ShenandoahHeapRegion::reset_alloc_metadata_to_shared() {
|
||||
if (used() > 0) {
|
||||
_tlab_allocs = 0;
|
||||
_gclab_allocs = 0;
|
||||
if (ShenandoahHeap::heap()->is_traversal_mode()) {
|
||||
update_seqnum_last_alloc_mutator();
|
||||
}
|
||||
} else {
|
||||
reset_alloc_metadata();
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahHeapRegion::update_seqnum_last_alloc_mutator() {
|
||||
assert(ShenandoahHeap::heap()->is_traversal_mode(), "Sanity");
|
||||
shenandoah_assert_heaplocked_or_safepoint();
|
||||
_seqnum_last_alloc_mutator = _alloc_seq_num.value++;
|
||||
}
|
||||
|
||||
size_t ShenandoahHeapRegion::get_shared_allocs() const {
|
||||
return used() - (_tlab_allocs + _gclab_allocs) * HeapWordSize;
|
||||
}
|
||||
@ -417,7 +403,6 @@ void ShenandoahHeapRegion::print_on(outputStream* st) const {
|
||||
st->print("|S " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_shared_allocs()), proper_unit_for_byte_size(get_shared_allocs()));
|
||||
st->print("|L " SIZE_FORMAT_W(5) "%1s", byte_size_in_proper_unit(get_live_data_bytes()), proper_unit_for_byte_size(get_live_data_bytes()));
|
||||
st->print("|CP " SIZE_FORMAT_W(3), pin_count());
|
||||
st->print("|SN " UINT64_FORMAT_X_W(12), _seqnum_last_alloc_mutator);
|
||||
st->cr();
|
||||
}
|
||||
|
||||
|
@ -221,21 +221,6 @@ private:
|
||||
static size_t MaxTLABSizeBytes;
|
||||
static size_t MaxTLABSizeWords;
|
||||
|
||||
// Global allocation counter, increased for each allocation under Shenandoah heap lock.
|
||||
// Padded to avoid false sharing with the read-only fields above.
|
||||
struct PaddedAllocSeqNum {
|
||||
shenandoah_padding(0);
|
||||
uint64_t value;
|
||||
shenandoah_padding(1);
|
||||
|
||||
PaddedAllocSeqNum() {
|
||||
// start with 1, reserve 0 for uninitialized value
|
||||
value = 1;
|
||||
}
|
||||
};
|
||||
|
||||
static PaddedAllocSeqNum _alloc_seq_num;
|
||||
|
||||
// Never updated fields
|
||||
size_t const _index;
|
||||
HeapWord* const _bottom;
|
||||
@ -254,8 +239,6 @@ private:
|
||||
size_t _tlab_allocs;
|
||||
size_t _gclab_allocs;
|
||||
|
||||
uint64_t _seqnum_last_alloc_mutator;
|
||||
|
||||
volatile size_t _live_data;
|
||||
volatile size_t _critical_pins;
|
||||
|
||||
@ -344,11 +327,6 @@ public:
|
||||
return ShenandoahHeapRegion::MaxTLABSizeWords;
|
||||
}
|
||||
|
||||
static uint64_t seqnum_current_alloc() {
|
||||
// Last used seq number
|
||||
return _alloc_seq_num.value - 1;
|
||||
}
|
||||
|
||||
inline size_t index() const {
|
||||
return _index;
|
||||
}
|
||||
@ -404,9 +382,6 @@ public:
|
||||
size_t get_tlab_allocs() const;
|
||||
size_t get_gclab_allocs() const;
|
||||
|
||||
inline uint64_t seqnum_last_alloc_mutator() const;
|
||||
void update_seqnum_last_alloc_mutator();
|
||||
|
||||
HeapWord* get_update_watermark() const {
|
||||
// Updates to the update-watermark only happen at safepoints or, when pushing
|
||||
// back the watermark for evacuation regions, under the Shenandoah heap-lock.
|
||||
|
@ -88,9 +88,4 @@ inline void ShenandoahHeapRegion::internal_increase_live_data(size_t s) {
|
||||
#endif
|
||||
}
|
||||
|
||||
inline uint64_t ShenandoahHeapRegion::seqnum_last_alloc_mutator() const {
|
||||
assert(ShenandoahHeap::heap()->is_traversal_mode(), "Sanity");
|
||||
return _seqnum_last_alloc_mutator;
|
||||
}
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGION_INLINE_HPP
|
||||
|
@ -84,7 +84,6 @@ void ShenandoahHeapRegionCounters::update() {
|
||||
if (heap->is_concurrent_mark_in_progress()) status |= 1 << 0;
|
||||
if (heap->is_evacuation_in_progress()) status |= 1 << 1;
|
||||
if (heap->is_update_refs_in_progress()) status |= 1 << 2;
|
||||
if (heap->is_concurrent_traversal_in_progress()) status |= 1 << 3;
|
||||
_status->set_value(status);
|
||||
|
||||
_timestamp->set_value(os::elapsed_counter());
|
||||
|
@ -39,7 +39,6 @@
|
||||
* - bit 0 set when marking in progress
|
||||
* - bit 1 set when evacuation in progress
|
||||
* - bit 2 set when update refs in progress
|
||||
* - bit 3 set when traversal in progress
|
||||
*
|
||||
* two variable counters per region, with $max_regions (see above) counters:
|
||||
* - sun.gc.shenandoah.regions.region.$i.data
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "gc/shenandoah/shenandoahHeuristics.hpp"
|
||||
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahRootProcessor.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "gc/shenandoah/shenandoahTaskqueue.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahUtils.hpp"
|
||||
#include "gc/shenandoah/shenandoahVerifier.hpp"
|
||||
@ -102,12 +101,6 @@ void ShenandoahMarkCompact::do_it(GCCause::Cause gc_cause) {
|
||||
}
|
||||
assert(!heap->is_update_refs_in_progress(), "sanity");
|
||||
|
||||
// a3. Cancel concurrent traversal GC, if in progress
|
||||
if (heap->is_concurrent_traversal_in_progress()) {
|
||||
heap->traversal_gc()->reset();
|
||||
heap->set_concurrent_traversal_in_progress(false);
|
||||
}
|
||||
|
||||
// b. Cancel concurrent mark, if in progress
|
||||
if (heap->is_concurrent_mark_in_progress()) {
|
||||
heap->concurrent_mark()->cancel();
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "gc/shenandoah/shenandoahHeap.hpp"
|
||||
#include "gc/shenandoah/shenandoahStrDedupQueue.hpp"
|
||||
#include "gc/shenandoah/shenandoahTaskqueue.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "memory/iterator.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
|
||||
@ -199,159 +198,4 @@ public:
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalSuperClosure : public MetadataVisitingOopIterateClosure {
|
||||
private:
|
||||
ShenandoahTraversalGC* const _traversal_gc;
|
||||
Thread* const _thread;
|
||||
ShenandoahObjToScanQueue* const _queue;
|
||||
ShenandoahMarkingContext* const _mark_context;
|
||||
protected:
|
||||
ShenandoahTraversalSuperClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
MetadataVisitingOopIterateClosure(rp),
|
||||
_traversal_gc(ShenandoahHeap::heap()->traversal_gc()),
|
||||
_thread(Thread::current()),
|
||||
_queue(q),
|
||||
_mark_context(ShenandoahHeap::heap()->marking_context()) {
|
||||
}
|
||||
|
||||
template <class T, bool STRING_DEDUP, bool DEGEN, bool ATOMIC_UPDATE>
|
||||
void work(T* p);
|
||||
|
||||
};
|
||||
|
||||
class ShenandoahTraversalRootsClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, false, false, false>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalRootsClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return false; }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, false, false, true>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return false; }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalMetadataClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, false, false, true>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalMetadataClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return true; }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalDedupClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, true, false, true>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalDedupClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return false; }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalMetadataDedupClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, true, false, true>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalMetadataDedupClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return true; }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalDegenClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, false, true, false>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalDegenClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return false; }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalMetadataDegenClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, false, true, false>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalMetadataDegenClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return true; }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalDedupDegenClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, true, true, false>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalDedupDegenClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return false; }
|
||||
};
|
||||
|
||||
class ShenandoahTraversalMetadataDedupDegenClosure : public ShenandoahTraversalSuperClosure {
|
||||
private:
|
||||
template <class T>
|
||||
inline void do_oop_work(T* p) { work<T, true, true, false>(p); }
|
||||
|
||||
public:
|
||||
ShenandoahTraversalMetadataDedupDegenClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) :
|
||||
ShenandoahTraversalSuperClosure(q, rp) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop(oop* p) { do_oop_work(p); }
|
||||
|
||||
virtual bool do_metadata() { return true; }
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHOOPCLOSURES_HPP
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.inline.hpp"
|
||||
|
||||
template<class T, UpdateRefsMode UPDATE_REFS, StringDedupMode STRING_DEDUP>
|
||||
inline void ShenandoahMarkRefsSuperClosure::work(T *p) {
|
||||
@ -38,9 +37,4 @@ inline void ShenandoahUpdateHeapRefsClosure::do_oop_work(T* p) {
|
||||
_heap->maybe_update_with_forwarded(p);
|
||||
}
|
||||
|
||||
template <class T, bool STRING_DEDUP, bool DEGEN, bool ATOMIC_UPDATE>
|
||||
inline void ShenandoahTraversalSuperClosure::work(T* p) {
|
||||
_traversal_gc->process_oop<T, STRING_DEDUP, DEGEN, ATOMIC_UPDATE>(p, _thread, _queue, _mark_context);
|
||||
}
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHOOPCLOSURES_INLINE_HPP
|
||||
|
@ -127,33 +127,6 @@ void ShenandoahPacer::setup_for_updaterefs() {
|
||||
tax);
|
||||
}
|
||||
|
||||
/*
|
||||
* Traversal walks the entire heap once, and therefore we have to make assumptions about its
|
||||
* liveness, like concurrent mark does.
|
||||
*/
|
||||
|
||||
void ShenandoahPacer::setup_for_traversal() {
|
||||
assert(ShenandoahPacing, "Only be here when pacing is enabled");
|
||||
|
||||
size_t live = update_and_get_progress_history();
|
||||
size_t free = _heap->free_set()->available();
|
||||
|
||||
size_t non_taxable = free * ShenandoahPacingCycleSlack / 100;
|
||||
size_t taxable = free - non_taxable;
|
||||
|
||||
double tax = 1.0 * live / taxable; // base tax for available free space
|
||||
tax *= ShenandoahPacingSurcharge; // additional surcharge to help unclutter heap
|
||||
|
||||
restart_with(non_taxable, tax);
|
||||
|
||||
log_info(gc, ergo)("Pacer for Traversal. Expected Live: " SIZE_FORMAT "%s, Free: " SIZE_FORMAT "%s, "
|
||||
"Non-Taxable: " SIZE_FORMAT "%s, Alloc Tax Rate: %.1fx",
|
||||
byte_size_in_proper_unit(live), proper_unit_for_byte_size(live),
|
||||
byte_size_in_proper_unit(free), proper_unit_for_byte_size(free),
|
||||
byte_size_in_proper_unit(non_taxable), proper_unit_for_byte_size(non_taxable),
|
||||
tax);
|
||||
}
|
||||
|
||||
/*
|
||||
* In idle phase, we have to pace the application to let control thread react with GC start.
|
||||
*
|
||||
|
@ -72,7 +72,6 @@ public:
|
||||
void setup_for_mark();
|
||||
void setup_for_evac();
|
||||
void setup_for_updaterefs();
|
||||
void setup_for_traversal();
|
||||
|
||||
void setup_for_reset();
|
||||
void setup_for_preclean();
|
||||
|
@ -75,9 +75,6 @@ void ShenandoahPhaseTimings::record_workers_end(Phase phase) {
|
||||
guarantee(phase == init_evac ||
|
||||
phase == scan_roots ||
|
||||
phase == update_roots ||
|
||||
phase == init_traversal_gc_work ||
|
||||
phase == final_traversal_gc_work ||
|
||||
phase == final_traversal_update_roots ||
|
||||
phase == final_update_refs_roots ||
|
||||
phase == full_gc_roots ||
|
||||
phase == degen_gc_update_roots ||
|
||||
|
@ -105,24 +105,6 @@ class outputStream;
|
||||
f(degen_gc_update_roots, " Degen Update Roots") \
|
||||
SHENANDOAH_GC_PAR_PHASE_DO(degen_gc_update_, " DU: ", f) \
|
||||
\
|
||||
f(init_traversal_gc_gross, "Pause Init Traversal (G)") \
|
||||
f(init_traversal_gc, "Pause Init Traversal (N)") \
|
||||
f(traversal_gc_prepare, " Prepare") \
|
||||
f(traversal_gc_make_parsable, " Make Parsable") \
|
||||
f(traversal_gc_resize_tlabs, " Resize TLABs") \
|
||||
f(traversal_gc_prepare_sync_pinned, " Sync Pinned") \
|
||||
f(init_traversal_gc_work, " Work") \
|
||||
SHENANDOAH_GC_PAR_PHASE_DO(init_traversal_, " TI: ", f) \
|
||||
\
|
||||
f(final_traversal_gc_gross, "Pause Final Traversal (G)") \
|
||||
f(final_traversal_gc, "Pause Final Traversal (N)") \
|
||||
f(final_traversal_gc_work, " Work") \
|
||||
SHENANDOAH_GC_PAR_PHASE_DO(final_trav_gc_, " TF: ", f) \
|
||||
f(final_traversal_update_roots, " Update Roots") \
|
||||
SHENANDOAH_GC_PAR_PHASE_DO(final_trav_update_, " TU: ", f) \
|
||||
f(traversal_gc_sync_pinned, " Sync Pinned") \
|
||||
f(traversal_gc_cleanup, " Cleanup") \
|
||||
\
|
||||
f(full_gc_gross, "Pause Full GC (G)") \
|
||||
f(full_gc, "Pause Full GC (N)") \
|
||||
f(full_gc_heapdumps, " Heap Dumps") \
|
||||
@ -156,7 +138,6 @@ class outputStream;
|
||||
f(conc_evac, "Concurrent Evacuation") \
|
||||
f(conc_update_refs, "Concurrent Update Refs") \
|
||||
f(conc_cleanup, "Concurrent Cleanup") \
|
||||
f(conc_traversal, "Concurrent Traversal") \
|
||||
\
|
||||
f(conc_uncommit, "Concurrent Uncommit") \
|
||||
\
|
||||
|
@ -222,19 +222,15 @@ void ShenandoahRootScanner<ITR>::strong_roots_do(uint worker_id, OopClosure* oop
|
||||
template <typename ITR>
|
||||
void ShenandoahRootScanner<ITR>::roots_do(uint worker_id, OopClosure* oops, CLDClosure* clds, CodeBlobClosure* code, ThreadClosure *tc) {
|
||||
assert(!ShenandoahSafepoint::is_at_shenandoah_safepoint() ||
|
||||
!ShenandoahHeap::heap()->unload_classes() ||
|
||||
ShenandoahHeap::heap()->is_traversal_mode(),
|
||||
"Expect class unloading or traversal when Shenandoah cycle is running");
|
||||
!ShenandoahHeap::heap()->unload_classes(),
|
||||
"Expect class unloading when Shenandoah cycle is running");
|
||||
ResourceMark rm;
|
||||
|
||||
_serial_roots.oops_do(oops, worker_id);
|
||||
_vm_roots.oops_do(oops, worker_id);
|
||||
|
||||
if (clds != NULL) {
|
||||
assert(clds != NULL, "Only possible with CLD closure");
|
||||
_cld_roots.cld_do(clds, worker_id);
|
||||
} else {
|
||||
assert(ShenandoahHeap::heap()->is_concurrent_traversal_in_progress(), "Only possible with traversal GC");
|
||||
}
|
||||
|
||||
// With ShenandoahConcurrentScanCodeRoots, we avoid scanning the entire code cache here,
|
||||
// and instead do that in concurrent phase under the relevant lock. This saves init mark
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_HPP
|
||||
#define SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_HPP
|
||||
|
||||
#include "memory/allocation.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
|
||||
#include "gc/shenandoah/shenandoahTaskqueue.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
|
||||
class ShenandoahTraversalGC : public CHeapObj<mtGC> {
|
||||
private:
|
||||
ShenandoahHeap* const _heap;
|
||||
ShenandoahObjToScanQueueSet* const _task_queues;
|
||||
ShenandoahHeapRegionSet _traversal_set;
|
||||
|
||||
public:
|
||||
ShenandoahTraversalGC(ShenandoahHeap* heap, size_t num_regions);
|
||||
~ShenandoahTraversalGC();
|
||||
|
||||
ShenandoahHeapRegionSet* traversal_set() { return &_traversal_set; }
|
||||
|
||||
void reset();
|
||||
void prepare();
|
||||
void init_traversal_collection();
|
||||
void concurrent_traversal_collection();
|
||||
void final_traversal_collection();
|
||||
|
||||
template <class T, bool STRING_DEDUP, bool DEGEN, bool ATOMIC_UPDATE>
|
||||
inline void process_oop(T* p, Thread* thread, ShenandoahObjToScanQueue* queue, ShenandoahMarkingContext* const mark_context);
|
||||
|
||||
bool check_and_handle_cancelled_gc(ShenandoahTaskTerminator* terminator, bool sts_yield);
|
||||
|
||||
ShenandoahObjToScanQueueSet* task_queues();
|
||||
|
||||
void main_loop(uint worker_id, ShenandoahTaskTerminator* terminator, bool sts_yield);
|
||||
|
||||
private:
|
||||
void prepare_regions();
|
||||
|
||||
template <class T>
|
||||
void main_loop_work(T* cl, jushort* live_data, uint worker_id, ShenandoahTaskTerminator* terminator, bool sts_yield);
|
||||
|
||||
void preclean_weak_refs();
|
||||
void weak_refs_work();
|
||||
void weak_refs_work_doit();
|
||||
|
||||
void fixup_roots();
|
||||
void verify_roots_after_gc();
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_HPP
|
@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_INLINE_HPP
|
||||
#define SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_INLINE_HPP
|
||||
|
||||
#include "gc/shenandoah/shenandoahAsserts.hpp"
|
||||
#include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
|
||||
#include "gc/shenandoah/shenandoahStringDedup.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalGC.hpp"
|
||||
#include "gc/shenandoah/shenandoahTaskqueue.hpp"
|
||||
#include "gc/shenandoah/shenandoahTaskqueue.inline.hpp"
|
||||
#include "oops/compressedOops.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
template <class T, bool STRING_DEDUP, bool DEGEN, bool ATOMIC_UPDATE>
|
||||
void ShenandoahTraversalGC::process_oop(T* p, Thread* thread, ShenandoahObjToScanQueue* queue, ShenandoahMarkingContext* const mark_context) {
|
||||
T o = RawAccess<>::oop_load(p);
|
||||
if (!CompressedOops::is_null(o)) {
|
||||
oop obj = CompressedOops::decode_not_null(o);
|
||||
if (DEGEN) {
|
||||
assert(!ATOMIC_UPDATE, "Degen path assumes non-atomic updates");
|
||||
oop forw = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
|
||||
if (obj != forw) {
|
||||
// Update reference.
|
||||
RawAccess<IS_NOT_NULL>::oop_store(p, forw);
|
||||
}
|
||||
obj = forw;
|
||||
} else if (_heap->in_collection_set(obj)) {
|
||||
oop forw = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
|
||||
if (obj == forw) {
|
||||
ShenandoahEvacOOMScope evac_scope;
|
||||
forw = _heap->evacuate_object(obj, thread);
|
||||
}
|
||||
shenandoah_assert_forwarded_except(p, obj, _heap->cancelled_gc());
|
||||
// Update reference.
|
||||
if (ATOMIC_UPDATE) {
|
||||
ShenandoahHeap::cas_oop(forw, p, obj);
|
||||
} else {
|
||||
RawAccess<IS_NOT_NULL>::oop_store(p, forw);
|
||||
}
|
||||
obj = forw;
|
||||
}
|
||||
|
||||
shenandoah_assert_not_forwarded(p, obj);
|
||||
shenandoah_assert_not_in_cset_except(p, obj, _heap->cancelled_gc());
|
||||
|
||||
if (mark_context->mark(obj)) {
|
||||
bool succeeded = queue->push(ShenandoahMarkTask(obj));
|
||||
assert(succeeded, "must succeed to push to task queue");
|
||||
|
||||
if (STRING_DEDUP && ShenandoahStringDedup::is_candidate(obj) && !_heap->cancelled_gc()) {
|
||||
assert(ShenandoahStringDedup::is_enabled(), "Must be enabled");
|
||||
// Only dealing with to-space string, so that we can avoid evac-oom protocol, which is costly here.
|
||||
shenandoah_assert_not_in_cset(p, obj);
|
||||
ShenandoahStringDedup::enqueue_candidate(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALGC_INLINE_HPP
|
@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shenandoah/shenandoahTraversalMode.hpp"
|
||||
#include "gc/shenandoah/heuristics/shenandoahTraversalAggressiveHeuristics.hpp"
|
||||
#include "gc/shenandoah/heuristics/shenandoahTraversalHeuristics.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "logging/logTag.hpp"
|
||||
|
||||
void ShenandoahTraversalMode::initialize_flags() const {
|
||||
FLAG_SET_DEFAULT(ShenandoahSATBBarrier, false);
|
||||
FLAG_SET_DEFAULT(ShenandoahStoreValEnqueueBarrier, true);
|
||||
FLAG_SET_DEFAULT(ShenandoahKeepAliveBarrier, false);
|
||||
FLAG_SET_DEFAULT(ShenandoahAllowMixedAllocs, false);
|
||||
|
||||
SHENANDOAH_ERGO_ENABLE_FLAG(ExplicitGCInvokesConcurrent);
|
||||
SHENANDOAH_ERGO_ENABLE_FLAG(ShenandoahImplicitGCInvokesConcurrent);
|
||||
|
||||
// Final configuration checks
|
||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahLoadRefBarrier);
|
||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahStoreValEnqueueBarrier);
|
||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
|
||||
SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
|
||||
}
|
||||
|
||||
ShenandoahHeuristics* ShenandoahTraversalMode::initialize_heuristics() const {
|
||||
if (ShenandoahGCHeuristics != NULL) {
|
||||
if (strcmp(ShenandoahGCHeuristics, "adaptive") == 0) {
|
||||
return new ShenandoahTraversalHeuristics();
|
||||
} else if (strcmp(ShenandoahGCHeuristics, "aggressive") == 0) {
|
||||
return new ShenandoahTraversalAggressiveHeuristics();
|
||||
} else {
|
||||
vm_exit_during_initialization("Unknown -XX:ShenandoahGCHeuristics option");
|
||||
}
|
||||
}
|
||||
ShouldNotReachHere();
|
||||
return NULL;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALMODE_HPP
|
||||
#define SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALMODE_HPP
|
||||
|
||||
#include "gc/shenandoah/shenandoahMode.hpp"
|
||||
|
||||
class ShenandoahHeuristics;
|
||||
|
||||
class ShenandoahTraversalMode : public ShenandoahMode {
|
||||
public:
|
||||
virtual void initialize_flags() const;
|
||||
virtual ShenandoahHeuristics* initialize_heuristics() const;
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHTRAVERSALMODE_HPP
|
@ -123,9 +123,6 @@ bool ShenandoahGCPhase::is_root_work_phase() {
|
||||
case ShenandoahPhaseTimings::init_evac:
|
||||
case ShenandoahPhaseTimings::final_update_refs_roots:
|
||||
case ShenandoahPhaseTimings::degen_gc_update_roots:
|
||||
case ShenandoahPhaseTimings::init_traversal_gc_work:
|
||||
case ShenandoahPhaseTimings::final_traversal_gc_work:
|
||||
case ShenandoahPhaseTimings::final_traversal_update_roots:
|
||||
case ShenandoahPhaseTimings::full_gc_roots:
|
||||
return true;
|
||||
default:
|
||||
|
@ -107,8 +107,6 @@ public:
|
||||
VM_Operation::VMOp_Type type = vm_op->type();
|
||||
return type == VM_Operation::VMOp_ShenandoahInitMark ||
|
||||
type == VM_Operation::VMOp_ShenandoahFinalMarkStartEvac ||
|
||||
type == VM_Operation::VMOp_ShenandoahInitTraversalGC ||
|
||||
type == VM_Operation::VMOp_ShenandoahFinalTraversalGC ||
|
||||
type == VM_Operation::VMOp_ShenandoahInitUpdateRefs ||
|
||||
type == VM_Operation::VMOp_ShenandoahFinalUpdateRefs ||
|
||||
type == VM_Operation::VMOp_ShenandoahFullGC ||
|
||||
|
@ -60,16 +60,6 @@ void VM_ShenandoahDegeneratedGC::doit() {
|
||||
ShenandoahHeap::heap()->entry_degenerated(_point);
|
||||
}
|
||||
|
||||
void VM_ShenandoahInitTraversalGC::doit() {
|
||||
ShenandoahGCPauseMark mark(_gc_id, SvcGCMarker::CONCURRENT);
|
||||
ShenandoahHeap::heap()->entry_init_traversal();
|
||||
}
|
||||
|
||||
void VM_ShenandoahFinalTraversalGC::doit() {
|
||||
ShenandoahGCPauseMark mark(_gc_id, SvcGCMarker::CONCURRENT);
|
||||
ShenandoahHeap::heap()->entry_final_traversal();
|
||||
}
|
||||
|
||||
void VM_ShenandoahInitUpdateRefs::doit() {
|
||||
ShenandoahGCPauseMark mark(_gc_id, SvcGCMarker::CONCURRENT);
|
||||
ShenandoahHeap::heap()->entry_init_updaterefs();
|
||||
|
@ -35,8 +35,6 @@
|
||||
// - VM_ShenandoahInitUpdateRefs: initiate update references
|
||||
// - VM_ShenandoahFinalUpdateRefs: finish up update references
|
||||
// - VM_ShenandoahFullGC: do full GC
|
||||
// - VM_ShenandoahInitTraversalGC: init traversal GC
|
||||
// - VM_ShenandoahFinalTraversalGC: finish traversal GC
|
||||
|
||||
class VM_ShenandoahOperation : public VM_Operation {
|
||||
protected:
|
||||
@ -90,22 +88,6 @@ public:
|
||||
virtual void doit();
|
||||
};
|
||||
|
||||
class VM_ShenandoahInitTraversalGC: public VM_ShenandoahOperation {
|
||||
public:
|
||||
VM_ShenandoahInitTraversalGC() : VM_ShenandoahOperation() {};
|
||||
VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahInitTraversalGC; }
|
||||
const char* name() const { return "Shenandoah Init Traversal Collection"; }
|
||||
virtual void doit();
|
||||
};
|
||||
|
||||
class VM_ShenandoahFinalTraversalGC: public VM_ShenandoahReferenceOperation {
|
||||
public:
|
||||
VM_ShenandoahFinalTraversalGC() : VM_ShenandoahReferenceOperation() {};
|
||||
VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalTraversalGC; }
|
||||
const char* name() const { return "Shenandoah Final Traversal Collection"; }
|
||||
virtual void doit();
|
||||
};
|
||||
|
||||
class VM_ShenandoahInitUpdateRefs: public VM_ShenandoahOperation {
|
||||
public:
|
||||
VM_ShenandoahInitUpdateRefs() : VM_ShenandoahOperation() {};
|
||||
|
@ -870,30 +870,6 @@ void ShenandoahVerifier::verify_after_degenerated() {
|
||||
);
|
||||
}
|
||||
|
||||
void ShenandoahVerifier::verify_before_traversal() {
|
||||
verify_at_safepoint(
|
||||
"Before Traversal",
|
||||
_verify_forwarded_none, // cannot have forwarded objects
|
||||
_verify_marked_disable, // bitmaps are not relevant before traversal
|
||||
_verify_cset_none, // no cset references before traversal
|
||||
_verify_liveness_disable, // no reliable liveness data anymore
|
||||
_verify_regions_notrash_nocset, // no trash and no cset regions
|
||||
_verify_gcstate_stable // nothing forwarded before traversal
|
||||
);
|
||||
}
|
||||
|
||||
void ShenandoahVerifier::verify_after_traversal() {
|
||||
verify_at_safepoint(
|
||||
"After Traversal",
|
||||
_verify_forwarded_none, // cannot have forwarded objects
|
||||
_verify_marked_complete, // should have complete marking after traversal
|
||||
_verify_cset_none, // no cset references left after traversal
|
||||
_verify_liveness_disable, // liveness data is not collected for new allocations
|
||||
_verify_regions_nocset, // no cset regions, trash regions allowed
|
||||
_verify_gcstate_stable // nothing forwarded after traversal
|
||||
);
|
||||
}
|
||||
|
||||
void ShenandoahVerifier::verify_before_fullgc() {
|
||||
verify_at_safepoint(
|
||||
"Before Full GC",
|
||||
|
@ -183,8 +183,6 @@ public:
|
||||
void verify_after_updaterefs();
|
||||
void verify_before_fullgc();
|
||||
void verify_after_fullgc();
|
||||
void verify_before_traversal();
|
||||
void verify_after_traversal();
|
||||
void verify_after_degenerated();
|
||||
void verify_generic(VerifyOption option);
|
||||
|
||||
|
@ -33,8 +33,6 @@ uint ShenandoahWorkerPolicy::_prev_conc_evac = 0;
|
||||
uint ShenandoahWorkerPolicy::_prev_conc_root_proc = 0;
|
||||
uint ShenandoahWorkerPolicy::_prev_fullgc = 0;
|
||||
uint ShenandoahWorkerPolicy::_prev_degengc = 0;
|
||||
uint ShenandoahWorkerPolicy::_prev_stw_traversal = 0;
|
||||
uint ShenandoahWorkerPolicy::_prev_conc_traversal = 0;
|
||||
uint ShenandoahWorkerPolicy::_prev_conc_update_ref = 0;
|
||||
uint ShenandoahWorkerPolicy::_prev_par_update_ref = 0;
|
||||
uint ShenandoahWorkerPolicy::_prev_conc_cleanup = 0;
|
||||
@ -104,26 +102,6 @@ uint ShenandoahWorkerPolicy::calc_workers_for_stw_degenerated() {
|
||||
return _prev_degengc;
|
||||
}
|
||||
|
||||
// Calculate workers for Stop-the-world traversal GC
|
||||
uint ShenandoahWorkerPolicy::calc_workers_for_stw_traversal() {
|
||||
uint active_workers = (_prev_stw_traversal == 0) ? ParallelGCThreads : _prev_stw_traversal;
|
||||
_prev_stw_traversal =
|
||||
WorkerPolicy::calc_active_workers(ParallelGCThreads,
|
||||
active_workers,
|
||||
Threads::number_of_non_daemon_threads());
|
||||
return _prev_stw_traversal;
|
||||
}
|
||||
|
||||
// Calculate workers for concurent traversal GC
|
||||
uint ShenandoahWorkerPolicy::calc_workers_for_conc_traversal() {
|
||||
uint active_workers = (_prev_conc_traversal == 0) ? ConcGCThreads : _prev_conc_traversal;
|
||||
_prev_conc_traversal =
|
||||
WorkerPolicy::calc_active_conc_workers(ConcGCThreads,
|
||||
active_workers,
|
||||
Threads::number_of_non_daemon_threads());
|
||||
return _prev_conc_traversal;
|
||||
}
|
||||
|
||||
// Calculate workers for concurrent reference update
|
||||
uint ShenandoahWorkerPolicy::calc_workers_for_conc_update_ref() {
|
||||
uint active_workers = (_prev_conc_update_ref == 0) ? ConcGCThreads : _prev_conc_update_ref;
|
||||
|
@ -34,8 +34,6 @@ private:
|
||||
static uint _prev_conc_evac;
|
||||
static uint _prev_fullgc;
|
||||
static uint _prev_degengc;
|
||||
static uint _prev_stw_traversal;
|
||||
static uint _prev_conc_traversal;
|
||||
static uint _prev_conc_update_ref;
|
||||
static uint _prev_par_update_ref;
|
||||
static uint _prev_conc_cleanup;
|
||||
@ -63,12 +61,6 @@ public:
|
||||
// Calculate workers for parallel degenerated gc
|
||||
static uint calc_workers_for_stw_degenerated();
|
||||
|
||||
// Calculate workers for Stop-the-world traversal GC
|
||||
static uint calc_workers_for_stw_traversal();
|
||||
|
||||
// Calculate workers for concurrent traversal GC
|
||||
static uint calc_workers_for_conc_traversal();
|
||||
|
||||
// Calculate workers for concurrent reference update
|
||||
static uint calc_workers_for_conc_update_ref();
|
||||
|
||||
|
@ -66,7 +66,6 @@
|
||||
"GC mode to use. Among other things, this defines which " \
|
||||
"barriers are in in use. Possible values are:" \
|
||||
" normal - default concurrent GC (three pass mark-evac-update);" \
|
||||
" traversal - traversal concurrent GC (single-pass); " \
|
||||
" passive - stop the world GC only (either degenerated or full)") \
|
||||
\
|
||||
experimental(ccstr, ShenandoahGCHeuristics, "adaptive", \
|
||||
|
@ -102,8 +102,6 @@
|
||||
template(ShenandoahFullGC) \
|
||||
template(ShenandoahInitMark) \
|
||||
template(ShenandoahFinalMarkStartEvac) \
|
||||
template(ShenandoahInitTraversalGC) \
|
||||
template(ShenandoahFinalTraversalGC) \
|
||||
template(ShenandoahInitUpdateRefs) \
|
||||
template(ShenandoahFinalUpdateRefs) \
|
||||
template(ShenandoahDegeneratedGC) \
|
||||
|
@ -38,8 +38,7 @@
|
||||
* and <testtype> in {G1,
|
||||
* Serial,
|
||||
* Parallel,
|
||||
* Shenandoah,
|
||||
* ShenandoahTraversal}
|
||||
* Shenandoah}
|
||||
*/
|
||||
|
||||
|
||||
@ -94,13 +93,6 @@ public class TestVolatiles {
|
||||
procArgs[argcount - 3] = "-XX:+UnlockExperimentalVMOptions";
|
||||
procArgs[argcount - 2] = "-XX:+UseShenandoahGC";
|
||||
break;
|
||||
case "ShenandoahTraversal":
|
||||
argcount = 11;
|
||||
procArgs = new String[argcount];
|
||||
procArgs[argcount - 4] = "-XX:+UnlockExperimentalVMOptions";
|
||||
procArgs[argcount - 3] = "-XX:+UseShenandoahGC";
|
||||
procArgs[argcount - 2] = "-XX:ShenandoahGCMode=traversal";
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("unexpected test type " + testType);
|
||||
}
|
||||
@ -331,7 +323,6 @@ public class TestVolatiles {
|
||||
};
|
||||
break;
|
||||
case "Shenandoah":
|
||||
case "ShenandoahTraversal":
|
||||
// Shenandoah generates normal object graphs for
|
||||
// volatile stores
|
||||
matches = new String[] {
|
||||
@ -410,7 +401,6 @@ public class TestVolatiles {
|
||||
break;
|
||||
|
||||
case "Shenandoah":
|
||||
case "ShenandoahTraversal":
|
||||
// Shenandoah generates normal object graphs for
|
||||
// volatile stores
|
||||
matches = new String[] {
|
||||
@ -500,7 +490,6 @@ public class TestVolatiles {
|
||||
};
|
||||
break;
|
||||
case "Shenandoah":
|
||||
case "ShenandoahTraversal":
|
||||
// For volatile CAS, Shenanodoah generates normal
|
||||
// graphs with a shenandoah-specific cmpxchg
|
||||
matches = new String[] {
|
||||
@ -578,7 +567,6 @@ public class TestVolatiles {
|
||||
};
|
||||
break;
|
||||
case "Shenandoah":
|
||||
case "ShenandoahTraversal":
|
||||
// For volatile CAS, Shenanodoah generates normal
|
||||
// graphs with a shenandoah-specific cmpxchg
|
||||
matches = new String[] {
|
||||
@ -684,7 +672,6 @@ public class TestVolatiles {
|
||||
};
|
||||
break;
|
||||
case "Shenandoah":
|
||||
case "ShenandoahTraversal":
|
||||
// For volatile CAS, Shenanodoah generates normal
|
||||
// graphs with a shenandoah-specific cmpxchg
|
||||
matches = new String[] {
|
||||
@ -762,7 +749,6 @@ public class TestVolatiles {
|
||||
};
|
||||
break;
|
||||
case "Shenandoah":
|
||||
case "ShenandoahTraversal":
|
||||
// For volatile CAS, Shenanodoah generates normal
|
||||
// graphs with a shenandoah-specific cmpxchg
|
||||
matches = new String[] {
|
||||
@ -848,7 +834,6 @@ public class TestVolatiles {
|
||||
};
|
||||
break;
|
||||
case "Shenandoah":
|
||||
case "ShenandoahTraversal":
|
||||
matches = new String[] {
|
||||
"membar_release \\(elided\\)",
|
||||
useCompressedOops ? "atomic_xchgw?_acq" : "atomic_xchg_acq",
|
||||
@ -924,7 +909,6 @@ public class TestVolatiles {
|
||||
};
|
||||
break;
|
||||
case "Shenandoah":
|
||||
case "ShenandoahTraversal":
|
||||
matches = new String[] {
|
||||
"membar_release",
|
||||
"dmb ish",
|
||||
|
@ -46,8 +46,6 @@ package gc;
|
||||
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.CriticalNativeArgs
|
||||
*
|
||||
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives gc.CriticalNativeArgs
|
||||
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCMode=traversal -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.CriticalNativeArgs
|
||||
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.CriticalNativeArgs
|
||||
*/
|
||||
public class CriticalNativeArgs {
|
||||
public static void main(String[] args) {
|
||||
|
@ -92,42 +92,6 @@
|
||||
* TestAllocHumongousFragment
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestAllocHumongousFragment
|
||||
* @summary Make sure Shenandoah can recover from humongous allocation fragmentation
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify
|
||||
* TestAllocHumongousFragment
|
||||
*
|
||||
* @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
|
||||
* TestAllocHumongousFragment
|
||||
*
|
||||
* @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* TestAllocHumongousFragment
|
||||
*
|
||||
* @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* TestAllocHumongousFragment
|
||||
*
|
||||
* @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestAllocHumongousFragment
|
||||
*
|
||||
* @run main/othervm -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g -XX:ShenandoahTargetNumRegions=2048
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestAllocHumongousFragment
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
|
@ -101,46 +101,6 @@
|
||||
* TestAllocIntArrays
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestAllocIntArrays
|
||||
* @summary Acceptance tests: collector can withstand allocation
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify
|
||||
* TestAllocIntArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
|
||||
* TestAllocIntArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* TestAllocIntArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* TestAllocIntArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestAllocIntArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestAllocIntArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestAllocIntArrays
|
||||
*/
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TestAllocIntArrays {
|
||||
|
@ -100,46 +100,6 @@
|
||||
* TestAllocObjectArrays
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestAllocObjectArrays
|
||||
* @summary Acceptance tests: collector can withstand allocation
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify
|
||||
* TestAllocObjectArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
|
||||
* TestAllocObjectArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* TestAllocObjectArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* TestAllocObjectArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestAllocObjectArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestAllocObjectArrays
|
||||
*
|
||||
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestAllocObjectArrays
|
||||
*/
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TestAllocObjectArrays {
|
||||
|
@ -116,51 +116,6 @@
|
||||
* TestAllocObjects
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestAllocObjects
|
||||
* @summary Acceptance tests: collector can withstand allocation
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify
|
||||
* TestAllocObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
|
||||
* TestAllocObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* TestAllocObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* TestAllocObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestAllocObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestAllocObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestAllocObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahSuspendibleWorkers
|
||||
* TestAllocObjects
|
||||
*/
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class TestAllocObjects {
|
||||
|
@ -83,25 +83,6 @@
|
||||
* TestGCThreadGroups
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test TestGCThreadGroups
|
||||
* @summary Test Shenandoah GC uses concurrent/parallel threads correctly
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
|
||||
* -Dtarget=1000
|
||||
* TestGCThreadGroups
|
||||
*
|
||||
* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
|
||||
* -Dtarget=1000
|
||||
* TestGCThreadGroups
|
||||
*/
|
||||
|
||||
public class TestGCThreadGroups {
|
||||
|
||||
static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle
|
||||
|
@ -81,26 +81,6 @@
|
||||
* TestHeapUncommit
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestHeapUncommit
|
||||
* @summary Acceptance tests: collector can withstand allocation
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahUncommit -XX:ShenandoahUncommitDelay=0
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestHeapUncommit
|
||||
*
|
||||
* @run main/othervm -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahUncommit -XX:ShenandoahUncommitDelay=0
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestHeapUncommit
|
||||
*
|
||||
* @run main/othervm -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahUncommit -XX:ShenandoahUncommitDelay=0
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestHeapUncommit
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestHeapUncommit
|
||||
* @key gc
|
||||
|
@ -77,34 +77,6 @@
|
||||
* TestLotsOfCycles
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestLotsOfCycles
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* -Dtarget=1000
|
||||
* TestLotsOfCycles
|
||||
*
|
||||
* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* -Dtarget=1000
|
||||
* TestLotsOfCycles
|
||||
*
|
||||
* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -Dtarget=1000
|
||||
* TestLotsOfCycles
|
||||
*
|
||||
* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -Dtarget=10000
|
||||
* TestLotsOfCycles
|
||||
*/
|
||||
|
||||
public class TestLotsOfCycles {
|
||||
|
||||
static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle
|
||||
|
@ -57,7 +57,6 @@ public class TestObjItrWithHeapDump {
|
||||
|
||||
String[][][] modeHeuristics = new String[][][] {
|
||||
{{"normal"}, {"adaptive", "compact", "static", "aggressive"}},
|
||||
{{"traversal"}, {"adaptive", "aggressive"}},
|
||||
{{"passive"}, {"passive"}}
|
||||
};
|
||||
|
||||
|
@ -98,36 +98,6 @@ public class TestPeriodicGC {
|
||||
);
|
||||
}
|
||||
|
||||
testWith("Zero interval with traversal mode",
|
||||
false,
|
||||
"-Xlog:gc",
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+UseShenandoahGC",
|
||||
"-XX:ShenandoahGCMode=traversal",
|
||||
"-XX:ShenandoahGuaranteedGCInterval=0"
|
||||
);
|
||||
|
||||
testWith("Short interval with traversal mode",
|
||||
true,
|
||||
"-Xlog:gc",
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+UseShenandoahGC",
|
||||
"-XX:ShenandoahGCMode=traversal",
|
||||
"-XX:ShenandoahGuaranteedGCInterval=1000"
|
||||
);
|
||||
|
||||
testWith("Long interval with traversal mode",
|
||||
false,
|
||||
"-Xlog:gc",
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+UseShenandoahGC",
|
||||
"-XX:ShenandoahGCMode=traversal",
|
||||
"-XX:ShenandoahGuaranteedGCInterval=100000" // deliberately too long
|
||||
);
|
||||
|
||||
testWith("Short interval with aggressive",
|
||||
false,
|
||||
"-Xlog:gc",
|
||||
|
@ -41,26 +41,6 @@
|
||||
* TestRefprocSanity
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestRefprocSanity
|
||||
* @summary Test that null references/referents work fine
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestRefprocSanity
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestRefprocSanity
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestRefprocSanity
|
||||
*/
|
||||
|
||||
import java.lang.ref.*;
|
||||
|
||||
public class TestRefprocSanity {
|
||||
|
@ -57,20 +57,6 @@
|
||||
* TestRegionSampling
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestRegionSampling
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestRegionSampling
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestRegionSampling
|
||||
*
|
||||
*/
|
||||
|
||||
public class TestRegionSampling {
|
||||
|
||||
static final long TARGET_MB = Long.getLong("target", 2_000); // 2 Gb allocation
|
||||
|
@ -91,36 +91,6 @@
|
||||
* TestRetainObjects
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestRetainObjects
|
||||
* @summary Acceptance tests: collector can deal with retained objects
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* TestRetainObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* TestRetainObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestRetainObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestRetainObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestRetainObjects
|
||||
*/
|
||||
|
||||
public class TestRetainObjects {
|
||||
|
||||
static final int COUNT = 10_000_000;
|
||||
|
@ -91,36 +91,6 @@
|
||||
* TestSieveObjects
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestSieveObjects
|
||||
* @summary Acceptance tests: collector can deal with retained objects
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* TestSieveObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* TestSieveObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestSieveObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestSieveObjects
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestSieveObjects
|
||||
*/
|
||||
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class TestSieveObjects {
|
||||
|
@ -65,25 +65,6 @@
|
||||
* TestStringDedup
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestStringDedup
|
||||
* @summary Test Shenandoah string deduplication implementation
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc:open
|
||||
* @modules java.base/java.lang:open
|
||||
* java.management
|
||||
*
|
||||
* @run main/othervm -Xmx256m -Xlog:gc+stats -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestStringDedup
|
||||
*
|
||||
* @run main/othervm -Xmx256m -Xlog:gc+stats -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestStringDedup
|
||||
*/
|
||||
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -73,38 +73,6 @@
|
||||
* TestStringDedupStress
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestStringDedupStress
|
||||
* @summary Test Shenandoah string deduplication implementation
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc:open
|
||||
* @modules java.base/java.lang:open
|
||||
* java.management
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xlog:gc+stats -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestStringDedupStress
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xlog:gc+stats -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -DtargetStrings=2000000
|
||||
* TestStringDedupStress
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xlog:gc+stats -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* -DtargetStrings=2000000
|
||||
* TestStringDedupStress
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xlog:gc+stats -Xlog:gc -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* -DtargetStrings=2000000
|
||||
* TestStringDedupStress
|
||||
*/
|
||||
|
||||
import java.lang.management.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
@ -76,27 +76,6 @@
|
||||
* TestStringInternCleanup
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestStringInternCleanup
|
||||
* @summary Check that Shenandoah cleans up interned strings
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx64m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ClassUnloadingWithConcurrentMark
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestStringInternCleanup
|
||||
*
|
||||
* @run main/othervm -Xmx64m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ClassUnloadingWithConcurrentMark
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahVerify
|
||||
* TestStringInternCleanup
|
||||
*
|
||||
* @run main/othervm -Xmx64m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ClassUnloadingWithConcurrentMark
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestStringInternCleanup
|
||||
*/
|
||||
|
||||
public class TestStringInternCleanup {
|
||||
|
||||
static final int COUNT = 1_000_000;
|
||||
|
@ -59,20 +59,6 @@
|
||||
* TestVerifyJCStress
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestVerifyJCStress
|
||||
* @summary Tests that we pass at least one jcstress-like test with all verification turned on
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
*
|
||||
* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify -XX:+IgnoreUnrecognizedVMOptions -XX:+ShenandoahVerifyOptoBarriers
|
||||
* TestVerifyJCStress
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.locks.*;
|
||||
|
@ -27,7 +27,6 @@
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC TestWrongArrayMember
|
||||
* @run main/othervm -Xmx128m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal TestWrongArrayMember
|
||||
*/
|
||||
|
||||
public class TestWrongArrayMember {
|
||||
|
@ -63,22 +63,6 @@
|
||||
* TestChurnNotifications
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestChurnNotifications
|
||||
* @summary Check that MX notifications are reported for all cycles
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -Dprecise=false
|
||||
* TestChurnNotifications
|
||||
*
|
||||
* @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -Dprecise=false
|
||||
* TestChurnNotifications
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.*;
|
||||
import javax.management.*;
|
||||
|
@ -61,21 +61,6 @@
|
||||
* TestPauseNotifications
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestPauseNotifications
|
||||
* @summary Check that MX notifications are reported for all cycles
|
||||
* @key gc
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
*
|
||||
* @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* TestPauseNotifications
|
||||
*
|
||||
* @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* TestPauseNotifications
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.*;
|
||||
import javax.management.*;
|
||||
|
@ -126,7 +126,6 @@ public class TestClassLoaderLeak {
|
||||
|
||||
String[][][] modeHeuristics = new String[][][] {
|
||||
{{"normal"}, {"adaptive", "compact", "static", "aggressive"}},
|
||||
{{"traversal"}, {"adaptive", "aggressive"}},
|
||||
{{"passive"}, {"passive"}}
|
||||
};
|
||||
|
||||
|
@ -59,11 +59,6 @@ public class TestExplicitGC {
|
||||
"Pause Final Mark",
|
||||
};
|
||||
|
||||
String[] concTraversal = new String[] {
|
||||
"Pause Init Traversal",
|
||||
"Pause Final Traversal",
|
||||
};
|
||||
|
||||
{
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
@ -78,9 +73,6 @@ public class TestExplicitGC {
|
||||
for (String p : concNormal) {
|
||||
output.shouldContain(p);
|
||||
}
|
||||
for (String p : concTraversal) {
|
||||
output.shouldNotContain(p);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@ -98,9 +90,6 @@ public class TestExplicitGC {
|
||||
for (String p : concNormal) {
|
||||
output.shouldNotContain(p);
|
||||
}
|
||||
for (String p : concTraversal) {
|
||||
output.shouldNotContain(p);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@ -118,30 +107,6 @@ public class TestExplicitGC {
|
||||
for (String p : concNormal) {
|
||||
output.shouldContain(p);
|
||||
}
|
||||
for (String p : concTraversal) {
|
||||
output.shouldNotContain(p);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+UseShenandoahGC",
|
||||
"-Xlog:gc",
|
||||
"-XX:+ExplicitGCInvokesConcurrent",
|
||||
"-XX:ShenandoahGCMode=traversal",
|
||||
TestExplicitGC.class.getName(),
|
||||
"test");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
for (String p : full) {
|
||||
output.shouldNotContain(p);
|
||||
}
|
||||
for (String p : concNormal) {
|
||||
output.shouldNotContain(p);
|
||||
}
|
||||
for (String p : concTraversal) {
|
||||
output.shouldContain(p);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@ -159,9 +124,6 @@ public class TestExplicitGC {
|
||||
for (String p : concNormal) {
|
||||
output.shouldNotContain(p);
|
||||
}
|
||||
for (String p : concTraversal) {
|
||||
output.shouldNotContain(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,8 +48,6 @@ public class TestHeuristicsUnlock {
|
||||
testWith("-XX:ShenandoahGCHeuristics=static", Mode.PRODUCT);
|
||||
testWith("-XX:ShenandoahGCHeuristics=compact", Mode.PRODUCT);
|
||||
|
||||
testWith("-XX:ShenandoahGCMode=traversal", Mode.PRODUCT);
|
||||
|
||||
testWith("-XX:ShenandoahGCHeuristics=aggressive", Mode.DIAGNOSTIC);
|
||||
testWith("-XX:ShenandoahGCHeuristics=passive", Mode.DIAGNOSTIC);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class TestSelectiveBarrierFlags {
|
||||
String[][] opts = {
|
||||
new String[] { "ShenandoahKeepAliveBarrier" },
|
||||
new String[] { "ShenandoahLoadRefBarrier" },
|
||||
new String[] { "ShenandoahSATBBarrier", "ShenandoahStoreValEnqueueBarrier" },
|
||||
new String[] { "ShenandoahSATBBarrier" },
|
||||
new String[] { "ShenandoahCASBarrier" },
|
||||
new String[] { "ShenandoahCloneBarrier" },
|
||||
};
|
||||
|
@ -45,19 +45,11 @@ public class TestWrongBarrierDisable {
|
||||
"ShenandoahKeepAliveBarrier",
|
||||
};
|
||||
|
||||
String[] traversal = {
|
||||
"ShenandoahLoadRefBarrier",
|
||||
"ShenandoahCASBarrier",
|
||||
"ShenandoahCloneBarrier",
|
||||
};
|
||||
|
||||
shouldFailAll("-XX:ShenandoahGCHeuristics=adaptive", concurrent);
|
||||
shouldFailAll("-XX:ShenandoahGCHeuristics=static", concurrent);
|
||||
shouldFailAll("-XX:ShenandoahGCHeuristics=compact", concurrent);
|
||||
shouldFailAll("-XX:ShenandoahGCHeuristics=aggressive", concurrent);
|
||||
shouldFailAll("-XX:ShenandoahGCMode=traversal", traversal);
|
||||
shouldPassAll("-XX:ShenandoahGCMode=passive", concurrent);
|
||||
shouldPassAll("-XX:ShenandoahGCMode=passive", traversal);
|
||||
}
|
||||
|
||||
private static void shouldFailAll(String h, String[] barriers) throws Exception {
|
||||
|
@ -48,8 +48,6 @@ import gc.CriticalNative;
|
||||
*
|
||||
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
|
||||
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xcomp -Xmx256M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
|
||||
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
|
||||
* @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive -Xcomp -Xmx512M -XX:+CriticalJNINatives gc.stress.CriticalNativeStress
|
||||
*/
|
||||
public class CriticalNativeStress {
|
||||
private static Random rand = new Random();
|
||||
|
@ -91,49 +91,6 @@ import java.io.IOException;
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
|
||||
* gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestGCBasherWithShenandoah
|
||||
* @key gc
|
||||
* @key stress
|
||||
* @library /
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
* @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled
|
||||
* @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects.
|
||||
*
|
||||
* @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
|
||||
*
|
||||
* @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
|
||||
*
|
||||
* @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestGCBasherWithShenandoah
|
||||
* @key gc
|
||||
* @key stress
|
||||
* @library /
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
* @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled
|
||||
* @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects.
|
||||
*
|
||||
* @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
|
||||
*
|
||||
* @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
|
||||
*/
|
||||
public class TestGCBasherWithShenandoah {
|
||||
public static void main(String[] args) throws IOException {
|
||||
TestGCBasher.main(args);
|
||||
|
@ -88,38 +88,6 @@ package gc.stress.gcold;
|
||||
* gc.stress.gcold.TestGCOld 50 1 20 10 10000
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestGCOldWithShenandoah
|
||||
* @key gc
|
||||
* @key stress
|
||||
* @library /
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
* @summary Stress the GC by trying to make old objects more likely to be garbage than young objects.
|
||||
*
|
||||
* @run main/othervm -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahOOMDuringEvacALot
|
||||
* gc.stress.gcold.TestGCOld 50 1 20 10 10000
|
||||
*
|
||||
* @run main/othervm -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* -XX:+ShenandoahAllocFailureALot
|
||||
* gc.stress.gcold.TestGCOld 50 1 20 10 10000
|
||||
*
|
||||
* @run main/othervm -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal -XX:ShenandoahGCHeuristics=aggressive
|
||||
* gc.stress.gcold.TestGCOld 50 1 20 10 10000
|
||||
*
|
||||
* @run main/othervm/timeout=600 -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* gc.stress.gcold.TestGCOld 50 1 20 10 10000
|
||||
*
|
||||
* @run main/othervm -Xmx384M -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* gc.stress.gcold.TestGCOld 50 1 20 10 10000
|
||||
*/
|
||||
|
||||
public class TestGCOldWithShenandoah {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -41,21 +41,6 @@ package gc.stress.systemgc;
|
||||
* -XX:+UseShenandoahGC
|
||||
* gc.stress.systemgc.TestSystemGCWithShenandoah 270
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test TestSystemGCWithShenandoah
|
||||
* @key gc
|
||||
* @key stress
|
||||
* @library /
|
||||
* @requires vm.gc.Shenandoah & !vm.graal.enabled
|
||||
* @summary Stress the Shenandoah GC full GC by allocating objects of different lifetimes concurrently with System.gc().
|
||||
*
|
||||
* @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions
|
||||
* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=traversal
|
||||
* -XX:+ShenandoahVerify
|
||||
* gc.stress.systemgc.TestSystemGCWithShenandoah 270
|
||||
*
|
||||
*/
|
||||
public class TestSystemGCWithShenandoah {
|
||||
public static void main(String[] args) throws Exception {
|
||||
TestSystemGC.main(args);
|
||||
|
Loading…
Reference in New Issue
Block a user