514 bool expect_null_mutator_alloc_region,
515 bool* gc_succeeded);
516
517 // Attempting to expand the heap sufficiently
518 // to support an allocation of the given "word_size". If
519 // successful, perform the allocation and return the address of the
520 // allocated block, or else "NULL".
521 HeapWord* expand_and_allocate(size_t word_size);
522
523 // Process any reference objects discovered.
524 void process_discovered_references(G1ParScanThreadStateSet* per_thread_states);
525
526 // If during an initial mark pause we may install a pending list head which is not
527 // otherwise reachable ensure that it is marked in the bitmap for concurrent marking
528 // to discover.
529 void make_pending_list_reachable();
530
531 // Merges the information gathered on a per-thread basis for all worker threads
532 // during GC into global variables.
533 void merge_per_thread_state_info(G1ParScanThreadStateSet* per_thread_states);
534 public:
535 G1YoungRemSetSamplingThread* sampling_thread() const { return _young_gen_sampling_thread; }
536
537 WorkGang* workers() const { return _workers; }
538
539 // Runs the given AbstractGangTask with the current active workers, returning the
540 // total time taken.
541 Tickspan run_task(AbstractGangTask* task);
542
543 G1Allocator* allocator() {
544 return _allocator;
545 }
546
547 G1HeapVerifier* verifier() {
548 return _verifier;
549 }
550
551 G1MonitoringSupport* g1mm() {
552 assert(_g1mm != NULL, "should have been initialized");
553 return _g1mm;
1268
1269 // Print the maximum heap capacity.
1270 virtual size_t max_capacity() const;
1271
1272 // Return the size of reserved memory. Returns different value than max_capacity() when AllocateOldGenAt is used.
1273 virtual size_t max_reserved_capacity() const;
1274
1275 virtual jlong millis_since_last_gc();
1276
1277
1278 // Convenience function to be used in situations where the heap type can be
1279 // asserted to be this type.
1280 static G1CollectedHeap* heap();
1281
1282 void set_region_short_lived_locked(HeapRegion* hr);
1283 // add appropriate methods for any other surv rate groups
1284
1285 const G1SurvivorRegions* survivor() const { return &_survivor; }
1286
1287 uint eden_regions_count() const { return _eden.length(); }
1288 uint survivor_regions_count() const { return _survivor.length(); }
1289 size_t eden_regions_used_bytes() const { return _eden.used_bytes(); }
1290 size_t survivor_regions_used_bytes() const { return _survivor.used_bytes(); }
1291 uint young_regions_count() const { return _eden.length() + _survivor.length(); }
1292 uint old_regions_count() const { return _old_set.length(); }
1293 uint archive_regions_count() const { return _archive_set.length(); }
1294 uint humongous_regions_count() const { return _humongous_set.length(); }
1295
1296 #ifdef ASSERT
1297 bool check_young_list_empty();
1298 #endif
1299
1300 // *** Stuff related to concurrent marking. It's not clear to me that so
1301 // many of these need to be public.
1302
1303 // The functions below are helper functions that a subclass of
1304 // "CollectedHeap" can use in the implementation of its virtual
1305 // functions.
1306 // This performs a concurrent marking of the live objects in a
1307 // bitmap off to the side.
1308 void do_concurrent_mark();
|
514 bool expect_null_mutator_alloc_region,
515 bool* gc_succeeded);
516
517 // Attempting to expand the heap sufficiently
518 // to support an allocation of the given "word_size". If
519 // successful, perform the allocation and return the address of the
520 // allocated block, or else "NULL".
521 HeapWord* expand_and_allocate(size_t word_size);
522
523 // Process any reference objects discovered.
524 void process_discovered_references(G1ParScanThreadStateSet* per_thread_states);
525
526 // If during an initial mark pause we may install a pending list head which is not
527 // otherwise reachable ensure that it is marked in the bitmap for concurrent marking
528 // to discover.
529 void make_pending_list_reachable();
530
531 // Merges the information gathered on a per-thread basis for all worker threads
532 // during GC into global variables.
533 void merge_per_thread_state_info(G1ParScanThreadStateSet* per_thread_states);
534
535 void verify_numa_regions();
536
537 public:
538 G1YoungRemSetSamplingThread* sampling_thread() const { return _young_gen_sampling_thread; }
539
540 WorkGang* workers() const { return _workers; }
541
542 // Runs the given AbstractGangTask with the current active workers, returning the
543 // total time taken.
544 Tickspan run_task(AbstractGangTask* task);
545
546 G1Allocator* allocator() {
547 return _allocator;
548 }
549
550 G1HeapVerifier* verifier() {
551 return _verifier;
552 }
553
554 G1MonitoringSupport* g1mm() {
555 assert(_g1mm != NULL, "should have been initialized");
556 return _g1mm;
1271
1272 // Print the maximum heap capacity.
1273 virtual size_t max_capacity() const;
1274
1275 // Return the size of reserved memory. Returns different value than max_capacity() when AllocateOldGenAt is used.
1276 virtual size_t max_reserved_capacity() const;
1277
1278 virtual jlong millis_since_last_gc();
1279
1280
1281 // Convenience function to be used in situations where the heap type can be
1282 // asserted to be this type.
1283 static G1CollectedHeap* heap();
1284
1285 void set_region_short_lived_locked(HeapRegion* hr);
1286 // add appropriate methods for any other surv rate groups
1287
1288 const G1SurvivorRegions* survivor() const { return &_survivor; }
1289
1290 uint eden_regions_count() const { return _eden.length(); }
1291 uint eden_regions_count(uint node_index) const { return _eden.length(node_index); }
1292 uint survivor_regions_count() const { return _survivor.length(); }
1293 uint survivor_regions_count(uint node_index) const { return _survivor.length(node_index); }
1294 size_t eden_regions_used_bytes() const { return _eden.used_bytes(); }
1295 size_t survivor_regions_used_bytes() const { return _survivor.used_bytes(); }
1296 uint young_regions_count() const { return _eden.length() + _survivor.length(); }
1297 uint old_regions_count() const { return _old_set.length(); }
1298 uint archive_regions_count() const { return _archive_set.length(); }
1299 uint humongous_regions_count() const { return _humongous_set.length(); }
1300
1301 #ifdef ASSERT
1302 bool check_young_list_empty();
1303 #endif
1304
1305 // *** Stuff related to concurrent marking. It's not clear to me that so
1306 // many of these need to be public.
1307
1308 // The functions below are helper functions that a subclass of
1309 // "CollectedHeap" can use in the implementation of its virtual
1310 // functions.
1311 // This performs a concurrent marking of the live objects in a
1312 // bitmap off to the side.
1313 void do_concurrent_mark();
|