491 ZStatHeap::set_at_relocate_start(capacity(), allocated(), used()); 492 493 // Remap/Relocate roots 494 _relocate.start(); 495 } 496 497 void ZHeap::relocate() { 498 // Relocate relocation set 499 const bool success = _relocate.relocate(&_relocation_set); 500 501 // Update statistics 502 ZStatSample(ZSamplerHeapUsedAfterRelocation, used()); 503 ZStatRelocation::set_at_relocate_end(success); 504 ZStatHeap::set_at_relocate_end(capacity(), allocated(), reclaimed(), 505 used(), used_high(), used_low()); 506 } 507 508 void ZHeap::object_iterate(ObjectClosure* cl, bool visit_referents) { 509 assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint"); 510 511 ZHeapIterator iter(visit_referents); 512 iter.objects_do(cl); 513 } 514 515 void ZHeap::serviceability_initialize() { 516 _serviceability.initialize(); 517 } 518 519 GCMemoryManager* ZHeap::serviceability_memory_manager() { 520 return _serviceability.memory_manager(); 521 } 522 523 MemoryPool* ZHeap::serviceability_memory_pool() { 524 return _serviceability.memory_pool(); 525 } 526 527 ZServiceabilityCounters* ZHeap::serviceability_counters() { 528 return _serviceability.counters(); 529 } 530 531 void ZHeap::print_on(outputStream* st) const { 532 st->print_cr(" ZHeap used " SIZE_FORMAT "M, capacity " SIZE_FORMAT "M, max capacity " SIZE_FORMAT "M", | 491 ZStatHeap::set_at_relocate_start(capacity(), allocated(), used()); 492 493 // Remap/Relocate roots 494 _relocate.start(); 495 } 496 497 void ZHeap::relocate() { 498 // Relocate relocation set 499 const bool success = _relocate.relocate(&_relocation_set); 500 501 // Update statistics 502 ZStatSample(ZSamplerHeapUsedAfterRelocation, used()); 503 ZStatRelocation::set_at_relocate_end(success); 504 ZStatHeap::set_at_relocate_end(capacity(), allocated(), reclaimed(), 505 used(), used_high(), used_low()); 506 } 507 508 void ZHeap::object_iterate(ObjectClosure* cl, bool visit_referents) { 509 assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint"); 510 511 ZHeapIterator iter; 512 iter.objects_do(cl, visit_referents); 513 } 514 515 void ZHeap::serviceability_initialize() { 516 _serviceability.initialize(); 517 } 518 519 GCMemoryManager* ZHeap::serviceability_memory_manager() { 520 return _serviceability.memory_manager(); 521 } 522 523 MemoryPool* ZHeap::serviceability_memory_pool() { 524 return _serviceability.memory_pool(); 525 } 526 527 ZServiceabilityCounters* ZHeap::serviceability_counters() { 528 return _serviceability.counters(); 529 } 530 531 void ZHeap::print_on(outputStream* st) const { 532 st->print_cr(" ZHeap used " SIZE_FORMAT "M, capacity " SIZE_FORMAT "M, max capacity " SIZE_FORMAT "M", |