< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

Print this page
rev 47675 : [mq]: 8149127-rename-concurrentrefine-a
rev 47676 : imported patch 8149127-rename-concurrentrefine-b
rev 47677 : [mq]: 8149127-rename-concurrentrefine-b-stefanj-review
rev 47678 : imported patch 8140255-move-sampling-thread
rev 47679 : [mq]: 8140255-update

*** 52,61 **** --- 52,62 ---- #include "gc/g1/g1RootClosures.hpp" #include "gc/g1/g1RootProcessor.hpp" #include "gc/g1/g1SerialFullCollector.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1YCTypes.hpp" + #include "gc/g1/g1YoungRemSetSamplingThread.hpp" #include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/g1/heapRegionSet.inline.hpp" #include "gc/g1/vm_operations_g1.hpp" #include "gc/shared/gcHeapSummary.hpp"
*** 1539,1548 **** --- 1540,1550 ---- // Public methods. G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* collector_policy) : CollectedHeap(), + _young_gen_sampling_thread(NULL), _collector_policy(collector_policy), _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()), _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()), _g1_policy(create_g1_policy(_gc_timer_stw)), _collection_set(this, _g1_policy),
*** 1635,1644 **** --- 1637,1655 ---- jint ecode = JNI_OK; _cr = G1ConcurrentRefine::create(&ecode); return ecode; } + jint G1CollectedHeap::initialize_young_gen_sampling_thread() { + _young_gen_sampling_thread = new G1YoungRemSetSamplingThread(); + if (_young_gen_sampling_thread->osthread() == NULL) { + vm_shutdown_during_initialization("Could not create G1YoungRemSetSamplingThread"); + return JNI_ENOMEM; + } + return JNI_OK; + } + jint G1CollectedHeap::initialize() { CollectedHeap::pre_initialize(); os::enable_vtime(); // Necessary to satisfy locking discipline assertions.
*** 1787,1796 **** --- 1798,1812 ---- jint ecode = initialize_concurrent_refinement(); if (ecode != JNI_OK) { return ecode; } + ecode = initialize_young_gen_sampling_thread(); + if (ecode != JNI_OK) { + return ecode; + } + JavaThread::dirty_card_queue_set().initialize(DirtyCardQ_CBL_mon, DirtyCardQ_FL_lock, (int)concurrent_refine()->yellow_zone(), (int)concurrent_refine()->red_zone(), Shared_DirtyCardQ_lock,
*** 1835,1844 **** --- 1851,1861 ---- void G1CollectedHeap::stop() { // Stop all concurrent threads. We do this to make sure these threads // do not continue to execute and access resources (e.g. logging) // that are destroyed during shutdown. _cr->stop(); + _young_gen_sampling_thread->stop(); _cmThread->stop(); if (G1StringDedup::is_enabled()) { G1StringDedup::stop(); } }
*** 2434,2454 **** void G1CollectedHeap::print_gc_threads_on(outputStream* st) const { workers()->print_worker_threads_on(st); _cmThread->print_on(st); st->cr(); _cm->print_worker_threads_on(st); ! _cr->print_worker_threads_on(st); // also prints the sample thread if (G1StringDedup::is_enabled()) { G1StringDedup::print_worker_threads_on(st); } } void G1CollectedHeap::gc_threads_do(ThreadClosure* tc) const { workers()->threads_do(tc); tc->do_thread(_cmThread); _cm->threads_do(tc); ! _cr->threads_do(tc); // also iterates over the sample thread if (G1StringDedup::is_enabled()) { G1StringDedup::threads_do(tc); } } --- 2451,2473 ---- void G1CollectedHeap::print_gc_threads_on(outputStream* st) const { workers()->print_worker_threads_on(st); _cmThread->print_on(st); st->cr(); _cm->print_worker_threads_on(st); ! _cr->print_threads_on(st); ! _young_gen_sampling_thread->print_on(st); if (G1StringDedup::is_enabled()) { G1StringDedup::print_worker_threads_on(st); } } void G1CollectedHeap::gc_threads_do(ThreadClosure* tc) const { workers()->threads_do(tc); tc->do_thread(_cmThread); _cm->threads_do(tc); ! _cr->threads_do(tc); ! tc->do_thread(_young_gen_sampling_thread); if (G1StringDedup::is_enabled()) { G1StringDedup::threads_do(tc); } }
< prev index next >