本文整理汇总了C++中ParallelScavengeHeap::resize_young_gen方法的典型用法代码示例。如果您正苦于以下问题:C++ ParallelScavengeHeap::resize_young_gen方法的具体用法?C++ ParallelScavengeHeap::resize_young_gen怎么用?C++ ParallelScavengeHeap::resize_young_gen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParallelScavengeHeap
的用法示例。
在下文中一共展示了ParallelScavengeHeap::resize_young_gen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: invoke_no_policy
//.........这里部分代码省略.........
size_t young_live = young_gen->used_in_bytes();
size_t eden_live = young_gen->eden_space()->used_in_bytes();
size_t old_live = old_gen->used_in_bytes();
size_t cur_eden = young_gen->eden_space()->capacity_in_bytes();
size_t max_old_gen_size = old_gen->max_gen_size();
size_t max_eden_size = young_gen->max_size() -
young_gen->from_space()->capacity_in_bytes() -
young_gen->to_space()->capacity_in_bytes();
// Used for diagnostics
size_policy->clear_generation_free_space_flags();
size_policy->compute_generations_free_space(young_live,
eden_live,
old_live,
cur_eden,
max_old_gen_size,
max_eden_size,
true /* full gc*/);
size_policy->check_gc_overhead_limit(young_live,
eden_live,
max_old_gen_size,
max_eden_size,
true /* full gc*/,
gc_cause,
heap->collector_policy());
size_policy->decay_supplemental_growth(true /* full gc*/);
heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes());
heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
size_policy->calculated_survivor_size_in_bytes());
}
if (PrintAdaptiveSizePolicy) {
gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",
heap->total_collections());
}
}
if (UsePerfData) {
heap->gc_policy_counters()->update_counters();
heap->gc_policy_counters()->update_old_capacity(
old_gen->capacity_in_bytes());
heap->gc_policy_counters()->update_young_capacity(
young_gen->capacity_in_bytes());
}
heap->resize_all_tlabs();
// We collected the heap, recalculate the metaspace capacity
MetaspaceGC::compute_new_size();
if (TraceOldGenTime) accumulated_time()->stop();
if (PrintGC) {
if (PrintGCDetails) {
// Don't print a GC timestamp here. This is after the GC so
// would be confusing.
young_gen->print_used_change(young_gen_prev_used);
old_gen->print_used_change(old_gen_prev_used);
}
heap->print_heap_change(prev_used);
if (PrintGCDetails) {
示例2: invoke_no_policy
//.........这里部分代码省略.........
if (UseAdaptiveSizePolicy &&
UseAdaptiveGenerationSizePolicyAtMinorCollection &&
((gc_cause != GCCause::_java_lang_system_gc) ||
UseAdaptiveSizePolicyWithSystemGC)) {
// Calculate optimial free space amounts
assert(young_gen->max_size() >
young_gen->from_space()->capacity_in_bytes() +
young_gen->to_space()->capacity_in_bytes(),
"Sizes of space in young gen are out-of-bounds");
size_t max_eden_size = young_gen->max_size() -
young_gen->from_space()->capacity_in_bytes() -
young_gen->to_space()->capacity_in_bytes();
size_policy->compute_generation_free_space(young_gen->used_in_bytes(),
young_gen->eden_space()->used_in_bytes(),
old_gen->used_in_bytes(),
perm_gen->used_in_bytes(),
young_gen->eden_space()->capacity_in_bytes(),
old_gen->max_gen_size(),
max_eden_size,
false /* full gc*/,
gc_cause);
}
// Resize the young generation at every collection
// even if new sizes have not been calculated. This is
// to allow resizes that may have been inhibited by the
// relative location of the "to" and "from" spaces.
// Resizing the old gen at minor collects can cause increases
// that don't feed back to the generation sizing policy until
// a major collection. Don't resize the old gen here.
heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
size_policy->calculated_survivor_size_in_bytes());
if (PrintAdaptiveSizePolicy) {
gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",
heap->total_collections());
}
}
// Update the structure of the eden. With NUMA-eden CPU hotplugging or offlining can
// cause the change of the heap layout. Make sure eden is reshaped if that's the case.
// Also update() will case adaptive NUMA chunk resizing.
assert(young_gen->eden_space()->is_empty(), "eden space should be empty now");
young_gen->eden_space()->update();
heap->gc_policy_counters()->update_counters();
heap->resize_all_tlabs();
assert(young_gen->to_space()->is_empty(), "to space should be empty now");
}
DerivedPointerTable::update_pointers();
NOT_PRODUCT(reference_processor()->verify_no_references_recorded());
// Re-verify object start arrays
if (VerifyObjectStartArray &&
VerifyAfterGC) {
old_gen->verify_object_start_array();
perm_gen->verify_object_start_array();
}
示例3: invoke_no_policy
//.........这里部分代码省略.........
size_t max_old_gen_size = old_gen->max_gen_size();
size_t max_eden_size = max_young_size -
young_gen->from_space()->capacity_in_bytes() -
young_gen->to_space()->capacity_in_bytes();
// Used for diagnostics
size_policy->clear_generation_free_space_flags();
size_policy->compute_eden_space_size(young_live,
eden_live,
cur_eden,
max_eden_size,
false /* not full gc*/);
size_policy->check_gc_overhead_limit(young_live,
eden_live,
max_old_gen_size,
max_eden_size,
false /* not full gc*/,
gc_cause,
heap->collector_policy());
size_policy->decay_supplemental_growth(false /* not full gc*/);
}
// Resize the young generation at every collection
// even if new sizes have not been calculated. This is
// to allow resizes that may have been inhibited by the
// relative location of the "to" and "from" spaces.
// Resizing the old gen at minor collects can cause increases
// that don't feed back to the generation sizing policy until
// a major collection. Don't resize the old gen here.
heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(),
size_policy->calculated_survivor_size_in_bytes());
if (PrintAdaptiveSizePolicy) {
gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ",
heap->total_collections());
}
}
// Update the structure of the eden. With NUMA-eden CPU hotplugging or offlining can
// cause the change of the heap layout. Make sure eden is reshaped if that's the case.
// Also update() will case adaptive NUMA chunk resizing.
assert(young_gen->eden_space()->is_empty(), "eden space should be empty now");
young_gen->eden_space()->update();
heap->gc_policy_counters()->update_counters();
heap->resize_all_tlabs();
assert(young_gen->to_space()->is_empty(), "to space should be empty now");
}
COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
NOT_PRODUCT(reference_processor()->verify_no_references_recorded());
{
GCTraceTime tm("Prune Scavenge Root Methods", false, false, &_gc_timer);
CodeCache::prune_scavenge_root_nmethods();
}
// Re-verify object start arrays