1415 |
1415 |
1416 _verifier->verify_after_gc(); |
1416 _verifier->verify_after_gc(); |
1417 |
1417 |
1418 // Clear the previous marking bitmap, if needed for bitmap verification. |
1418 // Clear the previous marking bitmap, if needed for bitmap verification. |
1419 // Note we cannot do this when we clear the next marking bitmap in |
1419 // Note we cannot do this when we clear the next marking bitmap in |
1420 // ConcurrentMark::abort() above since VerifyDuringGC verifies the |
1420 // G1ConcurrentMark::abort() above since VerifyDuringGC verifies the |
1421 // objects marked during a full GC against the previous bitmap. |
1421 // objects marked during a full GC against the previous bitmap. |
1422 // But we need to clear it before calling check_bitmaps below since |
1422 // But we need to clear it before calling check_bitmaps below since |
1423 // the full GC has compacted objects and updated TAMS but not updated |
1423 // the full GC has compacted objects and updated TAMS but not updated |
1424 // the prev bitmap. |
1424 // the prev bitmap. |
1425 if (G1VerifyBitmaps) { |
1425 if (G1VerifyBitmaps) { |
1426 ((CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll(); |
1426 ((G1CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll(); |
1427 } |
1427 } |
1428 _verifier->check_bitmaps("Full GC End"); |
1428 _verifier->check_bitmaps("Full GC End"); |
1429 |
1429 |
1430 // Start a new incremental collection set for the next pause |
1430 // Start a new incremental collection set for the next pause |
1431 assert(g1_policy()->collection_set() == NULL, "must be"); |
1431 assert(g1_policy()->collection_set() == NULL, "must be"); |
1922 G1RegionToSpaceMapper* card_counts_storage = |
1922 G1RegionToSpaceMapper* card_counts_storage = |
1923 create_aux_memory_mapper("Card counts table", |
1923 create_aux_memory_mapper("Card counts table", |
1924 G1CardCounts::compute_size(g1_rs.size() / HeapWordSize), |
1924 G1CardCounts::compute_size(g1_rs.size() / HeapWordSize), |
1925 G1CardCounts::heap_map_factor()); |
1925 G1CardCounts::heap_map_factor()); |
1926 |
1926 |
1927 size_t bitmap_size = CMBitMap::compute_size(g1_rs.size()); |
1927 size_t bitmap_size = G1CMBitMap::compute_size(g1_rs.size()); |
1928 G1RegionToSpaceMapper* prev_bitmap_storage = |
1928 G1RegionToSpaceMapper* prev_bitmap_storage = |
1929 create_aux_memory_mapper("Prev Bitmap", bitmap_size, CMBitMap::heap_map_factor()); |
1929 create_aux_memory_mapper("Prev Bitmap", bitmap_size, G1CMBitMap::heap_map_factor()); |
1930 G1RegionToSpaceMapper* next_bitmap_storage = |
1930 G1RegionToSpaceMapper* next_bitmap_storage = |
1931 create_aux_memory_mapper("Next Bitmap", bitmap_size, CMBitMap::heap_map_factor()); |
1931 create_aux_memory_mapper("Next Bitmap", bitmap_size, G1CMBitMap::heap_map_factor()); |
1932 |
1932 |
1933 _hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage); |
1933 _hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage); |
1934 g1_barrier_set()->initialize(cardtable_storage); |
1934 g1_barrier_set()->initialize(cardtable_storage); |
1935 // Do later initialization work for concurrent refinement. |
1935 // Do later initialization work for concurrent refinement. |
1936 _cg1r->init(card_counts_storage); |
1936 _cg1r->init(card_counts_storage); |
1958 |
1958 |
1959 _in_cset_fast_test.initialize(start, end, granularity); |
1959 _in_cset_fast_test.initialize(start, end, granularity); |
1960 _humongous_reclaim_candidates.initialize(start, end, granularity); |
1960 _humongous_reclaim_candidates.initialize(start, end, granularity); |
1961 } |
1961 } |
1962 |
1962 |
1963 // Create the ConcurrentMark data structure and thread. |
1963 // Create the G1ConcurrentMark data structure and thread. |
1964 // (Must do this late, so that "max_regions" is defined.) |
1964 // (Must do this late, so that "max_regions" is defined.) |
1965 _cm = new ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage); |
1965 _cm = new G1ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage); |
1966 if (_cm == NULL || !_cm->completed_initialization()) { |
1966 if (_cm == NULL || !_cm->completed_initialization()) { |
1967 vm_shutdown_during_initialization("Could not create/initialize ConcurrentMark"); |
1967 vm_shutdown_during_initialization("Could not create/initialize G1ConcurrentMark"); |
1968 return JNI_ENOMEM; |
1968 return JNI_ENOMEM; |
1969 } |
1969 } |
1970 _cmThread = _cm->cmThread(); |
1970 _cmThread = _cm->cmThread(); |
1971 |
1971 |
1972 // Now expand into the initial heap size. |
1972 // Now expand into the initial heap size. |
4990 } |
4990 } |
4991 |
4991 |
4992 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
4992 G1CollectedHeap* g1h = G1CollectedHeap::heap(); |
4993 |
4993 |
4994 oop obj = (oop)r->bottom(); |
4994 oop obj = (oop)r->bottom(); |
4995 CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap(); |
4995 G1CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap(); |
4996 |
4996 |
4997 // The following checks whether the humongous object is live are sufficient. |
4997 // The following checks whether the humongous object is live are sufficient. |
4998 // The main additional check (in addition to having a reference from the roots |
4998 // The main additional check (in addition to having a reference from the roots |
4999 // or the young gen) is whether the humongous object has a remembered set entry. |
4999 // or the young gen) is whether the humongous object has a remembered set entry. |
5000 // |
5000 // |