src/share/vm/memory/metaspace.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
bug_8003424.4 Cdiff src/share/vm/memory/metaspace.hpp
src/share/vm/memory/metaspace.hpp
Print this page
*** 103,112 ****
--- 103,122 ----
void initialize(Mutex* lock, MetaspaceType type);
// Align up the word size to the allocation word size
static size_t align_word_size_up(size_t);
+ // Aligned size of the metaspace.
+ static size_t _class_metaspace_size;
+
+ static size_t class_metaspace_size() {
+ return _class_metaspace_size;
+ }
+ static void set_class_metaspace_size(size_t metaspace_size) {
+ _class_metaspace_size = metaspace_size;
+ }
+
static size_t _first_chunk_word_size;
static size_t _first_class_chunk_word_size;
SpaceManager* _vsm;
SpaceManager* vsm() const { return _vsm; }
*** 129,138 ****
--- 139,159 ----
// This is used by DumpSharedSpaces only, where only _vsm is used. So we will
// maintain a single list for now.
void record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size);
+ #ifdef _LP64
+ static void set_narrow_klass_base_and_shift(address metaspace_base, address cds_base);
+
+ // Returns true if can use CDS with metaspace allocated as specified address.
+ static bool can_use_cds_with_metaspace_addr(char* metaspace_base, address cds_base);
+
+ static void allocate_metaspace_compressed_klass_ptrs(char* requested_addr, address cds_base);
+
+ static void initialize_class_space(ReservedSpace rs);
+ #endif
+
class AllocRecord : public CHeapObj<mtClass> {
public:
AllocRecord(address ptr, MetaspaceObj::Type type, int byte_size)
: _next(NULL), _ptr(ptr), _type(type), _byte_size(byte_size) {}
AllocRecord *_next;
*** 149,159 ****
Metaspace(Mutex* lock, MetaspaceType type);
~Metaspace();
// Initialize globals for Metaspace
static void global_initialize();
- static void initialize_class_space(ReservedSpace rs);
static size_t first_chunk_word_size() { return _first_chunk_word_size; }
static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; }
char* bottom() const;
--- 170,179 ----
*** 170,181 ****
void deallocate(MetaWord* ptr, size_t byte_size, bool is_class);
MetaWord* expand_and_allocate(size_t size,
MetadataType mdtype);
- static bool is_initialized() { return _class_space_list != NULL; }
-
static bool contains(const void *ptr);
void dump(outputStream* const out) const;
// Free empty virtualspaces
static void purge();
--- 190,199 ----
*** 188,197 ****
--- 206,221 ----
public:
virtual void doit(address ptr, MetaspaceObj::Type type, int byte_size) = 0;
};
void iterate(AllocRecordClosure *closure);
+
+ // Return TRUE only if UseCompressedKlassPointers is True and DumpSharedSpaces is False.
+ static bool using_class_space() {
+ return NOT_LP64(false) LP64_ONLY(UseCompressedKlassPointers && !DumpSharedSpaces);
+ }
+
};
class MetaspaceAux : AllStatic {
static size_t free_chunks_total(Metaspace::MetadataType mdtype);
static size_t free_chunks_total_in_bytes(Metaspace::MetadataType mdtype);
*** 241,252 ****
static size_t allocated_capacity_words(Metaspace::MetadataType mdtype) {
return _allocated_capacity_words[mdtype];
}
static size_t allocated_capacity_words() {
! return _allocated_capacity_words[Metaspace::ClassType] +
! _allocated_capacity_words[Metaspace::NonClassType];
}
static size_t allocated_capacity_bytes(Metaspace::MetadataType mdtype) {
return allocated_capacity_words(mdtype) * BytesPerWord;
}
static size_t allocated_capacity_bytes() {
--- 265,277 ----
static size_t allocated_capacity_words(Metaspace::MetadataType mdtype) {
return _allocated_capacity_words[mdtype];
}
static size_t allocated_capacity_words() {
! return _allocated_capacity_words[Metaspace::NonClassType] +
! (Metaspace::using_class_space() ?
! _allocated_capacity_words[Metaspace::ClassType] : 0);
}
static size_t allocated_capacity_bytes(Metaspace::MetadataType mdtype) {
return allocated_capacity_words(mdtype) * BytesPerWord;
}
static size_t allocated_capacity_bytes() {
*** 255,266 ****
static size_t allocated_used_words(Metaspace::MetadataType mdtype) {
return _allocated_used_words[mdtype];
}
static size_t allocated_used_words() {
! return _allocated_used_words[Metaspace::ClassType] +
! _allocated_used_words[Metaspace::NonClassType];
}
static size_t allocated_used_bytes(Metaspace::MetadataType mdtype) {
return allocated_used_words(mdtype) * BytesPerWord;
}
static size_t allocated_used_bytes() {
--- 280,292 ----
static size_t allocated_used_words(Metaspace::MetadataType mdtype) {
return _allocated_used_words[mdtype];
}
static size_t allocated_used_words() {
! return _allocated_used_words[Metaspace::NonClassType] +
! (Metaspace::using_class_space() ?
! _allocated_used_words[Metaspace::ClassType] : 0);
}
static size_t allocated_used_bytes(Metaspace::MetadataType mdtype) {
return allocated_used_words(mdtype) * BytesPerWord;
}
static size_t allocated_used_bytes() {
*** 298,307 ****
--- 324,334 ----
// Print change in used metadata.
static void print_metaspace_change(size_t prev_metadata_used);
static void print_on(outputStream * out);
static void print_on(outputStream * out, Metaspace::MetadataType mdtype);
+ static void print_class_waste(outputStream* out);
static void print_waste(outputStream* out);
static void dump(outputStream* out);
static void verify_free_chunks();
// Checks that the values returned by allocated_capacity_bytes() and
// capacity_bytes_slow() are the same.
src/share/vm/memory/metaspace.hpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File