hotspot/src/share/vm/memory/metaspace.cpp
changeset 46618 d503911aa948
parent 46602 f63ae85597f1
child 46619 a3919f5e8d2b
equal deleted inserted replaced
46617:0330c5fc49ce 46618:d503911aa948
   495   // This allocates memory with mmap.  For DumpSharedspaces, try to reserve
   495   // This allocates memory with mmap.  For DumpSharedspaces, try to reserve
   496   // configurable address, generally at the top of the Java heap so other
   496   // configurable address, generally at the top of the Java heap so other
   497   // memory addresses don't conflict.
   497   // memory addresses don't conflict.
   498   if (DumpSharedSpaces) {
   498   if (DumpSharedSpaces) {
   499     bool large_pages = false; // No large pages when dumping the CDS archive.
   499     bool large_pages = false; // No large pages when dumping the CDS archive.
   500     char* shared_base = (char*)align_ptr_up((char*)SharedBaseAddress, Metaspace::reserve_alignment());
   500     char* shared_base = align_ptr_up((char*)SharedBaseAddress, Metaspace::reserve_alignment());
   501 
   501 
   502     _rs = ReservedSpace(bytes, Metaspace::reserve_alignment(), large_pages, shared_base);
   502     _rs = ReservedSpace(bytes, Metaspace::reserve_alignment(), large_pages, shared_base);
   503     if (_rs.is_reserved()) {
   503     if (_rs.is_reserved()) {
   504       assert(shared_base == 0 || _rs.base() == shared_base, "should match");
   504       assert(shared_base == 0 || _rs.base() == shared_base, "should match");
   505     } else {
   505     } else {
  3128     // klass with a single MOVK instruction.  We can do this iff the
  3128     // klass with a single MOVK instruction.  We can do this iff the
  3129     // compressed class base is a multiple of 4G.
  3129     // compressed class base is a multiple of 4G.
  3130     // Aix: Search for a place where we can find memory. If we need to load
  3130     // Aix: Search for a place where we can find memory. If we need to load
  3131     // the base, 4G alignment is helpful, too.
  3131     // the base, 4G alignment is helpful, too.
  3132     size_t increment = AARCH64_ONLY(4*)G;
  3132     size_t increment = AARCH64_ONLY(4*)G;
  3133     for (char *a = (char*)align_ptr_up(requested_addr, increment);
  3133     for (char *a = align_ptr_up(requested_addr, increment);
  3134          a < (char*)(1024*G);
  3134          a < (char*)(1024*G);
  3135          a += increment) {
  3135          a += increment) {
  3136       if (a == (char *)(32*G)) {
  3136       if (a == (char *)(32*G)) {
  3137         // Go faster from here on. Zero-based is no longer possible.
  3137         // Go faster from here on. Zero-based is no longer possible.
  3138         increment = 4*G;
  3138         increment = 4*G;
  3353         cds_total = FileMapInfo::shared_spaces_size();
  3353         cds_total = FileMapInfo::shared_spaces_size();
  3354         cds_address = (address)mapinfo->header()->region_addr(0);
  3354         cds_address = (address)mapinfo->header()->region_addr(0);
  3355 #ifdef _LP64
  3355 #ifdef _LP64
  3356         if (using_class_space()) {
  3356         if (using_class_space()) {
  3357           char* cds_end = (char*)(cds_address + cds_total);
  3357           char* cds_end = (char*)(cds_address + cds_total);
  3358           cds_end = (char *)align_ptr_up(cds_end, _reserve_alignment);
  3358           cds_end = align_ptr_up(cds_end, _reserve_alignment);
  3359           // If UseCompressedClassPointers is set then allocate the metaspace area
  3359           // If UseCompressedClassPointers is set then allocate the metaspace area
  3360           // above the heap and above the CDS area (if it exists).
  3360           // above the heap and above the CDS area (if it exists).
  3361           allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address);
  3361           allocate_metaspace_compressed_klass_ptrs(cds_end, cds_address);
  3362           // Map the shared string space after compressed pointers
  3362           // Map the shared string space after compressed pointers
  3363           // because it relies on compressed class pointers setting to work
  3363           // because it relies on compressed class pointers setting to work