Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 355:0edda524b58c
6722565: G1: assert !r->is_on_unclean_list() fires
Summary: Under certain circumstances, two cleanup threads can claim and process the same region.
Reviewed-by: apetrusenko, ysr
author | tonyp |
---|---|
date | Wed, 06 Aug 2008 11:57:31 -0400 |
parents | 37f87013dfd8 |
children | ad8c8ca4ab0f |
comparison
equal
deleted
inserted
replaced
354:c0f8f7790199 | 355:0edda524b58c |
---|---|
2895 {} | 2895 {} |
2896 | 2896 |
2897 void work(int i) { | 2897 void work(int i) { |
2898 ParKnownGarbageHRClosure parKnownGarbageCl(_hrSorted, _chunk_size, i); | 2898 ParKnownGarbageHRClosure parKnownGarbageCl(_hrSorted, _chunk_size, i); |
2899 // Back to zero for the claim value. | 2899 // Back to zero for the claim value. |
2900 _g1->heap_region_par_iterate_chunked(&parKnownGarbageCl, i, 0); | 2900 _g1->heap_region_par_iterate_chunked(&parKnownGarbageCl, i, |
2901 HeapRegion::InitialClaimValue); | |
2901 jint regions_added = parKnownGarbageCl.marked_regions_added(); | 2902 jint regions_added = parKnownGarbageCl.marked_regions_added(); |
2902 _hrSorted->incNumMarkedHeapRegions(regions_added); | 2903 _hrSorted->incNumMarkedHeapRegions(regions_added); |
2903 if (G1PrintParCleanupStats) { | 2904 if (G1PrintParCleanupStats) { |
2904 gclog_or_tty->print(" Thread %d called %d times, added %d regions to list.\n", | 2905 gclog_or_tty->print(" Thread %d called %d times, added %d regions to list.\n", |
2905 i, parKnownGarbageCl.invokes(), regions_added); | 2906 i, parKnownGarbageCl.invokes(), regions_added); |
2931 _collectionSetChooser->prepareForAddMarkedHeapRegionsPar(_g1->n_regions(), | 2932 _collectionSetChooser->prepareForAddMarkedHeapRegionsPar(_g1->n_regions(), |
2932 ChunkSize); | 2933 ChunkSize); |
2933 ParKnownGarbageTask parKnownGarbageTask(_collectionSetChooser, | 2934 ParKnownGarbageTask parKnownGarbageTask(_collectionSetChooser, |
2934 (int) ChunkSize); | 2935 (int) ChunkSize); |
2935 _g1->workers()->run_task(&parKnownGarbageTask); | 2936 _g1->workers()->run_task(&parKnownGarbageTask); |
2937 | |
2938 assert(_g1->check_heap_region_claim_values(HeapRegion::InitialClaimValue), | |
2939 "sanity check"); | |
2936 } else { | 2940 } else { |
2937 KnownGarbageClosure knownGarbagecl(_collectionSetChooser); | 2941 KnownGarbageClosure knownGarbagecl(_collectionSetChooser); |
2938 _g1->heap_region_iterate(&knownGarbagecl); | 2942 _g1->heap_region_iterate(&knownGarbagecl); |
2939 } | 2943 } |
2940 double known_garbage_end; | 2944 double known_garbage_end; |