< prev index next >

src/hotspot/share/gc/z/zMarkStackAllocator.cpp

Print this page




  93   // Check expansion limit
  94   const size_t expand_size = ZMarkStackSpaceExpandSize;
  95   const size_t old_size = _end - _start;
  96   const size_t new_size = old_size + expand_size;
  97   if (new_size > ZMarkStackSpaceLimit) {
  98     // Expansion limit reached. This is a fatal error since we
  99     // currently can't recover from running out of mark stack space.
 100     fatal("Mark stack space exhausted. Use -XX:ZMarkStackSpaceLimit=<size> to increase the "
 101           "maximum number of bytes allocated for mark stacks. Current limit is " SIZE_FORMAT "M.",
 102           ZMarkStackSpaceLimit / M);
 103   }
 104 
 105   log_debug(gc, marking)("Expanding mark stack space: " SIZE_FORMAT "M->" SIZE_FORMAT "M",
 106                          old_size / M, new_size / M);
 107 
 108   // Expand
 109   os::commit_memory_or_exit((char*)_end, expand_size, false /* executable */, "Mark stack space");
 110 
 111   // Increment top before end to make sure another
 112   // thread can't steal out newly expanded space.
 113   addr = Atomic::add(size, &_top) - size;
 114   Atomic::add(expand_size, &_end);
 115 
 116   return addr;
 117 }
 118 
 119 uintptr_t ZMarkStackSpace::alloc(size_t size) {
 120   const uintptr_t addr = alloc_space(size);
 121   if (addr != 0) {
 122     return addr;
 123   }
 124 
 125   return expand_and_alloc_space(size);
 126 }
 127 
 128 ZMarkStackAllocator::ZMarkStackAllocator() :
 129     _freelist(),
 130     _space() {
 131   guarantee(sizeof(ZMarkStack) == ZMarkStackSize, "Size mismatch");
 132   guarantee(sizeof(ZMarkStackMagazine) <= ZMarkStackSize, "Size mismatch");
 133 
 134   // Prime free list to avoid an immediate space




  93   // Check expansion limit
  94   const size_t expand_size = ZMarkStackSpaceExpandSize;
  95   const size_t old_size = _end - _start;
  96   const size_t new_size = old_size + expand_size;
  97   if (new_size > ZMarkStackSpaceLimit) {
  98     // Expansion limit reached. This is a fatal error since we
  99     // currently can't recover from running out of mark stack space.
 100     fatal("Mark stack space exhausted. Use -XX:ZMarkStackSpaceLimit=<size> to increase the "
 101           "maximum number of bytes allocated for mark stacks. Current limit is " SIZE_FORMAT "M.",
 102           ZMarkStackSpaceLimit / M);
 103   }
 104 
 105   log_debug(gc, marking)("Expanding mark stack space: " SIZE_FORMAT "M->" SIZE_FORMAT "M",
 106                          old_size / M, new_size / M);
 107 
 108   // Expand
 109   os::commit_memory_or_exit((char*)_end, expand_size, false /* executable */, "Mark stack space");
 110 
 111   // Increment top before end to make sure another
 112   // thread can't steal out newly expanded space.
 113   addr = Atomic::add(&_top, size) - size;
 114   Atomic::add(&_end, expand_size);
 115 
 116   return addr;
 117 }
 118 
 119 uintptr_t ZMarkStackSpace::alloc(size_t size) {
 120   const uintptr_t addr = alloc_space(size);
 121   if (addr != 0) {
 122     return addr;
 123   }
 124 
 125   return expand_and_alloc_space(size);
 126 }
 127 
 128 ZMarkStackAllocator::ZMarkStackAllocator() :
 129     _freelist(),
 130     _space() {
 131   guarantee(sizeof(ZMarkStack) == ZMarkStackSize, "Size mismatch");
 132   guarantee(sizeof(ZMarkStackMagazine) <= ZMarkStackSize, "Size mismatch");
 133 
 134   // Prime free list to avoid an immediate space


< prev index next >