< prev index next >

src/hotspot/share/memory/metaspaceShared.cpp

Print this page

        

*** 88,119 **** // The CDS archive is divided into the following regions: // mc - misc code (the method entry trampolines) // rw - read-write metadata // ro - read-only metadata and read-only tables // md - misc data (the c++ vtables) // // ca0 - closed archive heap space #0 // ca1 - closed archive heap space #1 (may be empty) // oa0 - open archive heap space #0 // oa1 - open archive heap space #1 (may be empty) // ! // The mc, rw, ro, and md regions are linearly allocated, starting from ! // SharedBaseAddress, in the order of mc->rw->ro->md. The size of these 4 regions // are page-aligned, and there's no gap between any consecutive regions. // ! // These 4 regions are populated in the following steps: // [1] All classes are loaded in MetaspaceShared::preload_classes(). All metadata are // temporarily allocated outside of the shared regions. Only the method entry // trampolines are written into the mc region. // [2] ArchiveCompactor copies RW metadata into the rw region. // [3] ArchiveCompactor copies RO metadata into the ro region. // [4] SymbolTable, StringTable, SystemDictionary, and a few other read-only data // are copied into the ro region as read-only tables. // [5] C++ vtables are copied into the md region. // // The s0/s1 and oa0/oa1 regions are populated inside HeapShared::archive_java_heap_objects. ! // Their layout is independent of the other 4 regions. char* DumpRegion::expand_top_to(char* newtop) { assert(is_allocatable(), "must be initialized and not packed"); assert(newtop >= _top, "must not grow backwards"); if (newtop > _end) { --- 88,121 ---- // The CDS archive is divided into the following regions: // mc - misc code (the method entry trampolines) // rw - read-write metadata // ro - read-only metadata and read-only tables // md - misc data (the c++ vtables) + // od - optional data (original class files) // // ca0 - closed archive heap space #0 // ca1 - closed archive heap space #1 (may be empty) // oa0 - open archive heap space #0 // oa1 - open archive heap space #1 (may be empty) // ! // The mc, rw, ro, md and od regions are linearly allocated, starting from ! // SharedBaseAddress, in the order of mc->rw->ro->md->od. The size of these 5 regions // are page-aligned, and there's no gap between any consecutive regions. // ! // These 5 regions are populated in the following steps: // [1] All classes are loaded in MetaspaceShared::preload_classes(). All metadata are // temporarily allocated outside of the shared regions. Only the method entry // trampolines are written into the mc region. // [2] ArchiveCompactor copies RW metadata into the rw region. // [3] ArchiveCompactor copies RO metadata into the ro region. // [4] SymbolTable, StringTable, SystemDictionary, and a few other read-only data // are copied into the ro region as read-only tables. // [5] C++ vtables are copied into the md region. + // [6] Original class files are copied into the od region. // // The s0/s1 and oa0/oa1 regions are populated inside HeapShared::archive_java_heap_objects. ! // Their layout is independent of the other 5 regions. char* DumpRegion::expand_top_to(char* newtop) { assert(is_allocatable(), "must be initialized and not packed"); assert(newtop >= _top, "must not grow backwards"); if (newtop > _end) {
*** 170,180 **** next->_base = next->_top = this->_end; next->_end = MetaspaceShared::shared_rs()->end(); } } ! DumpRegion _mc_region("mc"), _ro_region("ro"), _rw_region("rw"), _md_region("md"); size_t _total_closed_archive_region_size = 0, _total_open_archive_region_size = 0; void MetaspaceShared::init_shared_dump_space(DumpRegion* first_space, address first_space_bottom) { // Start with 0 committed bytes. The memory will be committed as needed by // MetaspaceShared::commit_shared_space_to(). --- 172,182 ---- next->_base = next->_top = this->_end; next->_end = MetaspaceShared::shared_rs()->end(); } } ! DumpRegion _mc_region("mc"), _ro_region("ro"), _rw_region("rw"), _md_region("md"), _od_region("od"); size_t _total_closed_archive_region_size = 0, _total_open_archive_region_size = 0; void MetaspaceShared::init_shared_dump_space(DumpRegion* first_space, address first_space_bottom) { // Start with 0 committed bytes. The memory will be committed as needed by // MetaspaceShared::commit_shared_space_to().
*** 194,203 **** --- 196,209 ---- DumpRegion* MetaspaceShared::read_only_dump_space() { return &_ro_region; } + DumpRegion* MetaspaceShared::optional_data_dump_space() { + return &_od_region; + } + void MetaspaceShared::pack_dump_space(DumpRegion* current, DumpRegion* next, ReservedSpace* rs) { current->pack(next); }
*** 282,295 **** // On 64-bit VM, the heap and class space layout will be the same as if // you're running in -Xshare:on mode: // // +-- SharedBaseAddress (default = 0x800000000) // v ! // +-..---------+---------+ ... +----+----+----+----+---------------+ ! // | Heap | Archive | | MC | RW | RO | MD | class space | ! // +-..---------+---------+ ... +----+----+----+----+---------------+ ! // |<-- MaxHeapSize -->| |<-- UnscaledClassSpaceMax = 4GB -->| // const uint64_t UnscaledClassSpaceMax = (uint64_t(max_juint) + 1); const size_t cds_total = align_down(UnscaledClassSpaceMax, reserve_alignment); #else // We don't support archives larger than 256MB on 32-bit due to limited virtual address space. --- 288,301 ---- // On 64-bit VM, the heap and class space layout will be the same as if // you're running in -Xshare:on mode: // // +-- SharedBaseAddress (default = 0x800000000) // v ! // +-..---------+---------+ ... +----+----+----+----+----+---------------+ ! // | Heap | Archive | | MC | RW | RO | MD | OD | class space | ! // +-..---------+---------+ ... +----+----+----+----+----+---------------+ ! // |<-- MaxHeapSize -->| |<-- UnscaledClassSpaceMax = 4GB ------->| // const uint64_t UnscaledClassSpaceMax = (uint64_t(max_juint) + 1); const size_t cds_total = align_down(UnscaledClassSpaceMax, reserve_alignment); #else // We don't support archives larger than 256MB on 32-bit due to limited virtual address space.
*** 1066,1076 **** const char *sep = "--------------------+---------------------------+---------------------------+--------------------------"; const char *hdr = " ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %"; LogMessage(cds) msg; ! msg.info("Detailed metadata info (excluding st regions; rw stats include md/mc regions):"); msg.info("%s", hdr); msg.info("%s", sep); for (int type = 0; type < int(_number_of_types); type ++) { const char *name = type_name((Type)type); int ro_count = _counts[RO][type]; --- 1072,1082 ---- const char *sep = "--------------------+---------------------------+---------------------------+--------------------------"; const char *hdr = " ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %"; LogMessage(cds) msg; ! msg.info("Detailed metadata info (excluding od/st regions; rw stats include md/mc regions):"); msg.info("%s", hdr); msg.info("%s", sep); for (int type = 0; type < int(_number_of_types); type ++) { const char *name = type_name((Type)type); int ro_count = _counts[RO][type];
*** 1927,1941 **** void ReadClosure::do_u4(u4* p) { intptr_t obj = nextPtr(); *p = (u4)(uintx(obj)); } - void ReadClosure::do_bool(bool* p) { - intptr_t obj = nextPtr(); - *p = (bool)(uintx(obj)); - } - void ReadClosure::do_tag(int tag) { int old_tag; old_tag = (int)(intptr_t)nextPtr(); // do_int(&old_tag); assert(tag == old_tag, "old tag doesn't match"); --- 1933,1942 ----
< prev index next >