< prev index next >
src/share/vm/memory/filemap.hpp
Print this page
@@ -250,15 +250,26 @@
// Return true if given address is in the mapped shared space.
bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
bool is_in_shared_region(const void* p, int idx) NOT_CDS_RETURN_(false);
void print_shared_spaces() NOT_CDS_RETURN;
- static size_t shared_spaces_size() {
- return align_size_up(SharedReadOnlySize + SharedReadWriteSize +
- SharedMiscDataSize + SharedMiscCodeSize,
+ // 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 core_spaces_size() + optional_space_size();
+ }
// Stop CDS sharing and unmap CDS regions.
static void stop_sharing_and_unmap(const char* msg);
static void allocate_classpath_entry_table();
< prev index next >