39 #include "gc/g1/g1HeapTransition.hpp" |
39 #include "gc/g1/g1HeapTransition.hpp" |
40 #include "gc/g1/g1HeapVerifier.hpp" |
40 #include "gc/g1/g1HeapVerifier.hpp" |
41 #include "gc/g1/g1HRPrinter.hpp" |
41 #include "gc/g1/g1HRPrinter.hpp" |
42 #include "gc/g1/g1HeapRegionAttr.hpp" |
42 #include "gc/g1/g1HeapRegionAttr.hpp" |
43 #include "gc/g1/g1MonitoringSupport.hpp" |
43 #include "gc/g1/g1MonitoringSupport.hpp" |
|
44 #include "gc/g1/g1NUMA.hpp" |
44 #include "gc/g1/g1RedirtyCardsQueue.hpp" |
45 #include "gc/g1/g1RedirtyCardsQueue.hpp" |
45 #include "gc/g1/g1SurvivorRegions.hpp" |
46 #include "gc/g1/g1SurvivorRegions.hpp" |
46 #include "gc/g1/g1YCTypes.hpp" |
47 #include "gc/g1/g1YCTypes.hpp" |
47 #include "gc/g1/heapRegionManager.hpp" |
48 #include "gc/g1/heapRegionManager.hpp" |
48 #include "gc/g1/heapRegionSet.hpp" |
49 #include "gc/g1/heapRegionSet.hpp" |
189 void rebuild_region_sets(bool free_list_only); |
190 void rebuild_region_sets(bool free_list_only); |
190 |
191 |
191 // Callback for region mapping changed events. |
192 // Callback for region mapping changed events. |
192 G1RegionMappingChangedListener _listener; |
193 G1RegionMappingChangedListener _listener; |
193 |
194 |
|
195 // Handle G1 NUMA support. |
|
196 G1NUMA* _numa; |
|
197 |
194 // The sequence of all heap regions in the heap. |
198 // The sequence of all heap regions in the heap. |
195 HeapRegionManager* _hrm; |
199 HeapRegionManager* _hrm; |
196 |
200 |
197 // Manages all allocations with regions except humongous object allocations. |
201 // Manages all allocations with regions except humongous object allocations. |
198 G1Allocator* _allocator; |
202 G1Allocator* _allocator; |
385 // Try to allocate a single non-humongous HeapRegion sufficient for |
389 // Try to allocate a single non-humongous HeapRegion sufficient for |
386 // an allocation of the given word_size. If do_expand is true, |
390 // an allocation of the given word_size. If do_expand is true, |
387 // attempt to expand the heap if necessary to satisfy the allocation |
391 // attempt to expand the heap if necessary to satisfy the allocation |
388 // request. 'type' takes the type of region to be allocated. (Use constants |
392 // request. 'type' takes the type of region to be allocated. (Use constants |
389 // Old, Eden, Humongous, Survivor defined in HeapRegionType.) |
393 // Old, Eden, Humongous, Survivor defined in HeapRegionType.) |
390 HeapRegion* new_region(size_t word_size, HeapRegionType type, bool do_expand); |
394 HeapRegion* new_region(size_t word_size, |
|
395 HeapRegionType type, |
|
396 bool do_expand, |
|
397 uint node_index = G1NUMA::AnyNodeIndex); |
391 |
398 |
392 // Initialize a contiguous set of free regions of length num_regions |
399 // Initialize a contiguous set of free regions of length num_regions |
393 // and starting at index first so that they appear as a single |
400 // and starting at index first so that they appear as a single |
394 // humongous region. |
401 // humongous region. |
395 HeapWord* humongous_obj_allocate_initialize_regions(uint first, |
402 HeapWord* humongous_obj_allocate_initialize_regions(uint first, |
460 bool expect_null_mutator_alloc_region); |
467 bool expect_null_mutator_alloc_region); |
461 |
468 |
462 // These methods are the "callbacks" from the G1AllocRegion class. |
469 // These methods are the "callbacks" from the G1AllocRegion class. |
463 |
470 |
464 // For mutator alloc regions. |
471 // For mutator alloc regions. |
465 HeapRegion* new_mutator_alloc_region(size_t word_size, bool force); |
472 HeapRegion* new_mutator_alloc_region(size_t word_size, bool force, uint node_index); |
466 void retire_mutator_alloc_region(HeapRegion* alloc_region, |
473 void retire_mutator_alloc_region(HeapRegion* alloc_region, |
467 size_t allocated_bytes); |
474 size_t allocated_bytes); |
468 |
475 |
469 // For GC alloc regions. |
476 // For GC alloc regions. |
470 bool has_more_regions(G1HeapRegionAttr dest); |
477 bool has_more_regions(G1HeapRegionAttr dest); |
545 return _g1mm; |
552 return _g1mm; |
546 } |
553 } |
547 |
554 |
548 void resize_heap_if_necessary(); |
555 void resize_heap_if_necessary(); |
549 |
556 |
|
557 G1NUMA* numa() const { return _numa; } |
|
558 |
550 // Expand the garbage-first heap by at least the given size (in bytes!). |
559 // Expand the garbage-first heap by at least the given size (in bytes!). |
551 // Returns true if the heap was expanded by the requested amount; |
560 // Returns true if the heap was expanded by the requested amount; |
552 // false otherwise. |
561 // false otherwise. |
553 // (Rounds up to a HeapRegion boundary.) |
562 // (Rounds up to a HeapRegion boundary.) |
554 bool expand(size_t expand_bytes, WorkGang* pretouch_workers = NULL, double* expand_time_ms = NULL); |
563 bool expand(size_t expand_bytes, WorkGang* pretouch_workers = NULL, double* expand_time_ms = NULL); |
|
564 bool expand_single_region(uint node_index); |
555 |
565 |
556 // Returns the PLAB statistics for a given destination. |
566 // Returns the PLAB statistics for a given destination. |
557 inline G1EvacStats* alloc_buffer_stats(G1HeapRegionAttr dest); |
567 inline G1EvacStats* alloc_buffer_stats(G1HeapRegionAttr dest); |
558 |
568 |
559 // Determines PLAB size for a given destination. |
569 // Determines PLAB size for a given destination. |