--- old/src/share/vm/memory/filemap.hpp 2016-09-06 18:50:38.520881444 -0400 +++ new/src/share/vm/memory/filemap.hpp 2016-09-06 18:50:37.692834160 -0400 @@ -252,10 +252,21 @@ bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false); void print_shared_spaces() NOT_CDS_RETURN; + // The ro+rw+md+mc spaces size + static size_t core_spaces_size() { + return align_size_up((SharedReadOnlySize + SharedReadWriteSize + + SharedMiscDataSize + SharedMiscCodeSize), + os::vm_allocation_granularity()); + } + // The estimated optional space size. Only the portion containning data is + // written out to the archive and mapped at runtime. There is no memory waste + // due to unused portion in optional space. + static size_t optional_space_size() { + return core_spaces_size(); + } + // Total shared_spaces size includes the ro, rw, md, mc and od spaces static size_t shared_spaces_size() { - return align_size_up(SharedReadOnlySize + SharedReadWriteSize + - SharedMiscDataSize + SharedMiscCodeSize, - os::vm_allocation_granularity()); + return core_spaces_size() + optional_space_size(); } // Stop CDS sharing and unmap CDS regions.