CompactingPermGen::CompactingPermGen(ReservedSpace rs, ReservedSpace shared_rs, size_t initial_byte_size, GenRemSet* remset, PermanentGenerationSpec* perm_spec) { CompactingPermGenGen* g = new CompactingPermGenGen(rs, shared_rs, initial_byte_size, -1, remset, NULL, perm_spec); if (g == NULL) vm_exit_during_initialization("Could not allocate a CompactingPermGen"); _gen = g; g->initialize_performance_counters(); _capacity_expansion_limit = g->capacity() + MaxPermHeapExpansion; }
void CompactingPermGenGen::serialize_oops(SerializeOopClosure* soc) { int tag = 0; soc->do_tag(--tag); assert(!UseCompressedOops, "UseCompressedOops doesn't work with shared archive"); // Verify the sizes of various oops in the system. soc->do_tag(sizeof(oopDesc)); soc->do_tag(sizeof(instanceOopDesc)); soc->do_tag(sizeof(methodOopDesc)); soc->do_tag(sizeof(constMethodOopDesc)); soc->do_tag(sizeof(methodDataOopDesc)); soc->do_tag(arrayOopDesc::base_offset_in_bytes(T_BYTE)); soc->do_tag(sizeof(constantPoolOopDesc)); soc->do_tag(sizeof(constantPoolCacheOopDesc)); soc->do_tag(objArrayOopDesc::base_offset_in_bytes()); soc->do_tag(typeArrayOopDesc::base_offset_in_bytes(T_BYTE)); soc->do_tag(sizeof(symbolOopDesc)); soc->do_tag(sizeof(klassOopDesc)); soc->do_tag(sizeof(markOopDesc)); soc->do_tag(sizeof(compiledICHolderOopDesc)); // Dump the block offset table entries. GenCollectedHeap* gch = GenCollectedHeap::heap(); CompactingPermGenGen* pg = (CompactingPermGenGen*)gch->perm_gen(); pg->serialize_bts(soc); soc->do_tag(--tag); pg->ro_space()->serialize_block_offset_array_offsets(soc); soc->do_tag(--tag); pg->rw_space()->serialize_block_offset_array_offsets(soc); soc->do_tag(--tag); // Special case - this oop needed in oop->is_oop() assertions. soc->do_ptr((void**)&Universe::_klassKlassObj); soc->do_tag(--tag); // Dump/restore miscellaneous oops. Universe::oops_do(soc, true); soc->do_tag(--tag); vmSymbols::oops_do(soc, true); soc->do_tag(--tag); CodeCache::oops_do(soc); soc->do_tag(--tag); soc->do_tag(666); }
CompactingPermGen::CompactingPermGen(ReservedSpace rs, size_t initial_byte_size, GenRemSet* remset) { CompactingPermGenGen* g = new CompactingPermGenGen(rs, initial_byte_size, -1, remset, NULL); if (g == NULL) vm_exit_during_initialization("Could not allocate a CompactingPermGen"); HeapWord* bottom = (HeapWord*) g->_virtual_space.low(); HeapWord* end = (HeapWord*) g->_virtual_space.high(); g->_the_space = new ContigPermSpace(g->_bts, MemRegion(bottom, end)); if (g->_the_space == NULL) vm_exit_during_initialization("Could not allocate a CompactingPermGen Space"); _gen = g; g->initialize_performance_counters(); _capacity_expansion_limit = g->capacity() + MaxPermHeapExpansion; }
static void print_contents() { if (PrintSharedSpaces) { GenCollectedHeap* gch = GenCollectedHeap::heap(); CompactingPermGenGen* gen = (CompactingPermGenGen*)gch->perm_gen(); // High level summary of the read-only space: ClassifyObjectClosure coc; tty->cr(); tty->print_cr("ReadOnly space:"); gen->ro_space()->object_iterate(&coc); coc.print(); // High level summary of the read-write space: coc.reset(); tty->cr(); tty->print_cr("ReadWrite space:"); gen->rw_space()->object_iterate(&coc); coc.print(); // Reset counters ClearAllocCountClosure cacc; gen->ro_space()->object_iterate(&cacc); gen->rw_space()->object_iterate(&cacc); coc.reset(); // Lower level summary of the read-only space: gen->ro_space()->object_iterate(&coc); tty->cr(); tty->print_cr("ReadOnly space:"); ClassifyInstanceKlassClosure cikc; gen->rw_space()->object_iterate(&cikc); cikc.print(); // Reset counters gen->ro_space()->object_iterate(&cacc); gen->rw_space()->object_iterate(&cacc); coc.reset(); // Lower level summary of the read-write space: gen->rw_space()->object_iterate(&coc); cikc.reset(); tty->cr(); tty->print_cr("ReadWrite space:"); gen->rw_space()->object_iterate(&cikc); cikc.print(); } }