< prev index next >

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

Print this page




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #include "precompiled.hpp"
  25 #include "gc/shared/suspendibleThreadSet.hpp"
  26 #include "gc/z/zAddress.inline.hpp"
  27 #include "gc/z/zCollectedHeap.hpp"
  28 #include "gc/z/zFuture.inline.hpp"
  29 #include "gc/z/zGlobals.hpp"
  30 #include "gc/z/zLock.inline.hpp"
  31 #include "gc/z/zPage.inline.hpp"
  32 #include "gc/z/zPageAllocator.hpp"
  33 #include "gc/z/zPageCache.inline.hpp"
  34 #include "gc/z/zSafeDelete.inline.hpp"
  35 #include "gc/z/zStat.hpp"
  36 #include "gc/z/zTracer.inline.hpp"
  37 #include "runtime/globals.hpp"
  38 #include "runtime/init.hpp"
  39 #include "runtime/java.hpp"
  40 #include "utilities/debug.hpp"
  41 
  42 static const ZStatCounter       ZCounterAllocationRate("Memory", "Allocation Rate", ZStatUnitBytesPerSecond);
  43 static const ZStatCounter       ZCounterPageCacheFlush("Memory", "Page Cache Flush", ZStatUnitBytesPerSecond);
  44 static const ZStatCounter       ZCounterUncommit("Memory", "Uncommit", ZStatUnitBytesPerSecond);
  45 static const ZStatCriticalPhase ZCriticalPhaseAllocationStall("Allocation Stall");
  46 
  47 class ZPageAllocRequest : public StackObj {
  48   friend class ZList<ZPageAllocRequest>;
  49 
  50 private:
  51   const uint8_t                _type;
  52   const size_t                 _size;
  53   const ZAllocationFlags       _flags;
  54   const unsigned int           _total_collections;
  55   ZListNode<ZPageAllocRequest> _node;
  56   ZFuture<ZPage*>              _result;
  57 


 165   map_page(page);
 166   page->set_pre_mapped();
 167 
 168   // Add page to cache
 169   page->set_last_used();
 170   _cache.free_page(page);
 171 }
 172 
 173 bool ZPageAllocator::is_initialized() const {
 174   return _initialized;
 175 }
 176 
 177 size_t ZPageAllocator::min_capacity() const {
 178   return _min_capacity;
 179 }
 180 
 181 size_t ZPageAllocator::max_capacity() const {
 182   return _max_capacity;
 183 }
 184 
 185 size_t ZPageAllocator::soft_max_capacity() const {
 186   // Note that SoftMaxHeapSize is a manageable flag
 187   return MIN2(SoftMaxHeapSize, _current_max_capacity);
 188 }
 189 
 190 size_t ZPageAllocator::capacity() const {
 191   return _capacity;
 192 }
 193 
 194 size_t ZPageAllocator::max_reserve() const {
 195   return _max_reserve;
 196 }
 197 
 198 size_t ZPageAllocator::used_high() const {
 199   return _used_high;
 200 }
 201 
 202 size_t ZPageAllocator::used_low() const {
 203   return _used_low;
 204 }
 205 
 206 size_t ZPageAllocator::used() const {
 207   return _used;




  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 #include "precompiled.hpp"
  25 #include "gc/shared/suspendibleThreadSet.hpp"
  26 #include "gc/z/zAddress.inline.hpp"
  27 #include "gc/z/zCollectedHeap.hpp"
  28 #include "gc/z/zFuture.inline.hpp"
  29 #include "gc/z/zGlobals.hpp"
  30 #include "gc/z/zLock.inline.hpp"
  31 #include "gc/z/zPage.inline.hpp"
  32 #include "gc/z/zPageAllocator.hpp"
  33 #include "gc/z/zPageCache.inline.hpp"
  34 #include "gc/z/zSafeDelete.inline.hpp"
  35 #include "gc/z/zStat.hpp"
  36 #include "gc/z/zTracer.inline.hpp"

  37 #include "runtime/init.hpp"
  38 #include "runtime/java.hpp"
  39 #include "utilities/debug.hpp"
  40 
  41 static const ZStatCounter       ZCounterAllocationRate("Memory", "Allocation Rate", ZStatUnitBytesPerSecond);
  42 static const ZStatCounter       ZCounterPageCacheFlush("Memory", "Page Cache Flush", ZStatUnitBytesPerSecond);
  43 static const ZStatCounter       ZCounterUncommit("Memory", "Uncommit", ZStatUnitBytesPerSecond);
  44 static const ZStatCriticalPhase ZCriticalPhaseAllocationStall("Allocation Stall");
  45 
  46 class ZPageAllocRequest : public StackObj {
  47   friend class ZList<ZPageAllocRequest>;
  48 
  49 private:
  50   const uint8_t                _type;
  51   const size_t                 _size;
  52   const ZAllocationFlags       _flags;
  53   const unsigned int           _total_collections;
  54   ZListNode<ZPageAllocRequest> _node;
  55   ZFuture<ZPage*>              _result;
  56 


 164   map_page(page);
 165   page->set_pre_mapped();
 166 
 167   // Add page to cache
 168   page->set_last_used();
 169   _cache.free_page(page);
 170 }
 171 
 172 bool ZPageAllocator::is_initialized() const {
 173   return _initialized;
 174 }
 175 
 176 size_t ZPageAllocator::min_capacity() const {
 177   return _min_capacity;
 178 }
 179 
 180 size_t ZPageAllocator::max_capacity() const {
 181   return _max_capacity;
 182 }
 183 
 184 size_t ZPageAllocator::current_max_capacity() const {
 185   return _current_max_capacity;

 186 }
 187 
 188 size_t ZPageAllocator::capacity() const {
 189   return _capacity;
 190 }
 191 
 192 size_t ZPageAllocator::max_reserve() const {
 193   return _max_reserve;
 194 }
 195 
 196 size_t ZPageAllocator::used_high() const {
 197   return _used_high;
 198 }
 199 
 200 size_t ZPageAllocator::used_low() const {
 201   return _used_low;
 202 }
 203 
 204 size_t ZPageAllocator::used() const {
 205   return _used;


< prev index next >