提交 4e055d6b 编写于 作者: S stefank

Merge

......@@ -6068,6 +6068,10 @@ void CMSCollector::sweep(bool asynch) {
verify_work_stacks_empty();
verify_overflow_empty();
if (should_unload_classes()) {
ClassLoaderDataGraph::purge();
}
_intra_sweep_timer.stop();
_intra_sweep_estimate.sample(_intra_sweep_timer.seconds());
......
......@@ -166,7 +166,7 @@ class CMBitMap : public CMBitMapRO {
class CMMarkStack VALUE_OBJ_CLASS_SPEC {
VirtualSpace _virtual_space; // Underlying backing store for actual stack
ConcurrentMark* _cm;
oop* _base; // bottom of stack
oop* _base; // bottom of stack
jint _index; // one more than last occupied index
jint _capacity; // max #elements
jint _saved_index; // value of _index saved at start of GC
......@@ -491,9 +491,12 @@ protected:
// structures are initialised to a sensible and predictable state.
void set_non_marking_state();
// Called to indicate how many threads are currently active.
void set_concurrency(uint active_tasks);
// It should be called to indicate which phase we're in (concurrent
// mark or remark) and how many threads are currently active.
void set_phase(uint active_tasks, bool concurrent);
void set_concurrency_and_phase(uint active_tasks, bool concurrent);
// prints all gathered CM-related statistics
void print_stats();
......@@ -1146,7 +1149,9 @@ public:
// trying not to exceed the given duration. However, it might exit
// prematurely, according to some conditions (i.e. SATB buffers are
// available for processing).
void do_marking_step(double target_ms, bool do_stealing, bool do_termination);
void do_marking_step(double target_ms,
bool do_termination,
bool is_serial);
// These two calls start and stop the timer
void record_start_time() {
......
......@@ -656,7 +656,7 @@ void ParallelScavengeHeap::print_tracing_info() const {
tty->print_cr("[Accumulated GC generation 0 time %3.7f secs]", time);
}
if (TraceGen1Time) {
double time = PSMarkSweep::accumulated_time()->seconds();
double time = UseParallelOldGC ? PSParallelCompact::accumulated_time()->seconds() : PSMarkSweep::accumulated_time()->seconds();
tty->print_cr("[Accumulated GC generation 1 time %3.7f secs]", time);
}
}
......
......@@ -554,6 +554,8 @@ void GenCollectedHeap::do_collection(bool full,
}
if (complete) {
// Delete metaspaces for unloaded class loaders and clean up loader_data graph
ClassLoaderDataGraph::purge();
// Resize the metaspace capacity after full collections
MetaspaceGC::compute_new_size();
update_full_collections_completed();
......@@ -564,11 +566,6 @@ void GenCollectedHeap::do_collection(bool full,
gc_epilogue(complete);
// Delete metaspaces for unloaded class loaders and clean up loader_data graph
if (complete) {
ClassLoaderDataGraph::purge();
}
if (must_restore_marks_for_biased_locking) {
BiasedLocking::restore_marks();
}
......
......@@ -1103,25 +1103,24 @@ size_t MetaspaceGC::delta_capacity_until_GC(size_t word_size) {
}
bool MetaspaceGC::should_expand(VirtualSpaceList* vsl, size_t word_size) {
// Class virtual space should always be expanded. Call GC for the other
// metadata virtual space.
if (vsl == Metaspace::class_space_list()) return true;
// If the user wants a limit, impose one.
size_t max_metaspace_size_words = MaxMetaspaceSize / BytesPerWord;
size_t metaspace_size_words = MetaspaceSize / BytesPerWord;
if (!FLAG_IS_DEFAULT(MaxMetaspaceSize) &&
vsl->capacity_words_sum() >= max_metaspace_size_words) {
MetaspaceAux::reserved_in_bytes() >= MaxMetaspaceSize) {
return false;
}
// Class virtual space should always be expanded. Call GC for the other
// metadata virtual space.
if (vsl == Metaspace::class_space_list()) return true;
// If this is part of an allocation after a GC, expand
// unconditionally.
if(MetaspaceGC::expand_after_GC()) {
return true;
}
size_t metaspace_size_words = MetaspaceSize / BytesPerWord;
// If the capacity is below the minimum capacity, allow the
// expansion. Also set the high-water-mark (capacity_until_GC)
// to that minimum capacity so that a GC will not be induced
......@@ -1311,8 +1310,7 @@ void MetaspaceGC::compute_new_size() {
gclog_or_tty->print_cr(" metaspace HWM: %.1fK", new_capacity_until_GC / (double) K);
}
}
assert(vsl->used_bytes_sum() == used_after_gc &&
used_after_gc <= vsl->capacity_bytes_sum(),
assert(used_after_gc <= vsl->capacity_bytes_sum(),
"sanity check");
}
......@@ -1972,6 +1970,9 @@ void SpaceManager::initialize() {
}
SpaceManager::~SpaceManager() {
// This call this->_lock which can't be done while holding expand_lock()
const size_t in_use_before = sum_capacity_in_chunks_in_use();
MutexLockerEx fcl(SpaceManager::expand_lock(),
Mutex::_no_safepoint_check_flag);
......@@ -1989,7 +1990,7 @@ SpaceManager::~SpaceManager() {
// Have to update before the chunks_in_use lists are emptied
// below.
chunk_manager->inc_free_chunks_total(sum_capacity_in_chunks_in_use(),
chunk_manager->inc_free_chunks_total(in_use_before,
sum_count_in_chunks_in_use());
// Add all the chunks in use by this space manager
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册