Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 942:2c79770d1f6e
6819085: G1: use larger and/or user settable region size
Summary: Instead of the region size being hard-coded, allow the user to set it.
Reviewed-by: jmasa, johnc, apetrusenko
author | tonyp |
---|---|
date | Thu, 30 Jul 2009 16:22:58 -0400 |
parents | 8b46c4d82093 |
children | 54b3b351d6f9 |
comparison
equal
deleted
inserted
replaced
941:8b46c4d82093 | 942:2c79770d1f6e |
---|---|
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #include "incls/_precompiled.incl" | 25 #include "incls/_precompiled.incl" |
26 #include "incls/_g1CollectedHeap.cpp.incl" | 26 #include "incls/_g1CollectedHeap.cpp.incl" |
27 | |
28 size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0; | |
27 | 29 |
28 // turn it on so that the contents of the young list (scan-only / | 30 // turn it on so that the contents of the young list (scan-only / |
29 // to-be-collected) are printed at "strategic" points before / during | 31 // to-be-collected) are printed at "strategic" points before / during |
30 // / after the collection --- this is useful for debugging | 32 // / after the collection --- this is useful for debugging |
31 #define SCAN_ONLY_VERBOSE 0 | 33 #define SCAN_ONLY_VERBOSE 0 |
1392 _dirty_cards_region_list(NULL) { | 1394 _dirty_cards_region_list(NULL) { |
1393 _g1h = this; // To catch bugs. | 1395 _g1h = this; // To catch bugs. |
1394 if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) { | 1396 if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) { |
1395 vm_exit_during_initialization("Failed necessary allocation."); | 1397 vm_exit_during_initialization("Failed necessary allocation."); |
1396 } | 1398 } |
1399 | |
1400 _humongous_object_threshold_in_words = HeapRegion::GrainWords / 2; | |
1401 | |
1397 int n_queues = MAX2((int)ParallelGCThreads, 1); | 1402 int n_queues = MAX2((int)ParallelGCThreads, 1); |
1398 _task_queues = new RefToScanQueueSet(n_queues); | 1403 _task_queues = new RefToScanQueueSet(n_queues); |
1399 | 1404 |
1400 int n_rem_sets = HeapRegionRemSet::num_par_rem_sets(); | 1405 int n_rem_sets = HeapRegionRemSet::num_par_rem_sets(); |
1401 assert(n_rem_sets > 0, "Invariant."); | 1406 assert(n_rem_sets > 0, "Invariant."); |
1544 // 6843694 - ensure that the maximum region index can fit | 1549 // 6843694 - ensure that the maximum region index can fit |
1545 // in the remembered set structures. | 1550 // in the remembered set structures. |
1546 const size_t max_region_idx = ((size_t)1 << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1; | 1551 const size_t max_region_idx = ((size_t)1 << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1; |
1547 guarantee((max_regions() - 1) <= max_region_idx, "too many regions"); | 1552 guarantee((max_regions() - 1) <= max_region_idx, "too many regions"); |
1548 | 1553 |
1549 const size_t cards_per_region = HeapRegion::GrainBytes >> CardTableModRefBS::card_shift; | |
1550 size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1; | 1554 size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1; |
1551 guarantee(cards_per_region < max_cards_per_region, "too many cards per region"); | 1555 guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized"); |
1556 guarantee((size_t) HeapRegion::CardsPerRegion < max_cards_per_region, | |
1557 "too many cards per region"); | |
1552 | 1558 |
1553 _bot_shared = new G1BlockOffsetSharedArray(_reserved, | 1559 _bot_shared = new G1BlockOffsetSharedArray(_reserved, |
1554 heap_word_size(init_byte_size)); | 1560 heap_word_size(init_byte_size)); |
1555 | 1561 |
1556 _g1h = this; | 1562 _g1h = this; |