RFR: 8263002: Remove CDS MiscCode region
Coleen Phillimore
coleenp at openjdk.java.net
Tue Mar 9 00:06:12 UTC 2021
On Sun, 7 Mar 2021 06:26:00 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> The CDS MiscCode region is used for:
> (a) C++ vtables
> (b) Method trampolines
>
> (a) can be moved to the ReadWrite region
> (b) were introduced in JDK-8145221 so we can delay writing into Methods. This was intended to improve copy-on-write sharing to reduce memory footprint. However, this hasn't been shown to have any significant effect (footprint of metadata usually is much smaller than the Java heap), and introduces a lot of complexity in the HotSpot code.
>
> Removing (b) will make it easier to implement JDK-8026297 (Generating AdapterHandlerEntry during CDS dump), which will further improve start-up time.
>
> ============
> Other benefits of removing the MiscCode region:
>
> - We no longer have a read/write/executable region. This address the concern in JDK-8262922.
> - We can enable CDS on macOS/AArch64, which does not allow read/write/executable regions. (JDK-8253795)
wow. Looks good to me.
src/hotspot/share/memory/archiveBuilder.cpp line 831:
> 829: if (STATIC_DUMP) {
> 830: if (!_builder->is_in_buffer_space(*p)) {
> 831: tty->print_cr("ohashii %p %p", p, *p);
What is ohashii ? Should this be an assert? Or log_error instead of tty->print
src/hotspot/share/memory/cppVtables.cpp line 218:
> 216: assert(DumpSharedSpaces, "must");
> 217: size_t vtptrs_bytes = _num_cloned_vtable_kinds * sizeof(CppVtableInfo*);
> 218: _index = (CppVtableInfo**)ArchiveBuilder::current()->rw_region()->allocate(vtptrs_bytes);
I thought these would be read-only?
src/hotspot/share/memory/dumpAllocStats.cpp line 106:
> 104:
> 105: assert(all_ro_bytes == ro_all, "everything should have been counted");
> 106: //assert(all_rw_bytes == rw_all, "everything should have been counted"); FIXME!
? Does this need to be fixed?
-------------
Marked as reviewed by coleenp (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2861
More information about the hotspot-dev
mailing list