src/hotspot/share/memory/metaspace/commitLimiter.hpp
branchstuefe-new-metaspace-branch
changeset 59257 990b1fed3b47
parent 58063 bdf136b8ae0e
equal deleted inserted replaced
59238:6ce12ce00d3e 59257:990b1fed3b47
    29 #include "memory/allocation.hpp"
    29 #include "memory/allocation.hpp"
    30 #include "memory/metaspace/counter.hpp"
    30 #include "memory/metaspace/counter.hpp"
    31 
    31 
    32 namespace metaspace {
    32 namespace metaspace {
    33 
    33 
       
    34 // The CommitLimiter encapsulates the logic of "asking someone if it
       
    35 //  is okay to further commit n words of memory". It exists to separate
       
    36 //  this control logic from the low-level Metaspace code.
       
    37 //
       
    38 // The default variant of the CommitLimiter checks whether committing would
       
    39 //  trigger MaxMetaspaceSize, in which case committing is denied. It also checks
       
    40 //  whether we would hit the GC threshold, in which case committing is denied too.
       
    41 //
       
    42 // Other versions of this Limiter can be implemented for tests (see metaspace
       
    43 //  gtests).
    34 class CommitLimiter : public CHeapObj<mtInternal> {
    44 class CommitLimiter : public CHeapObj<mtInternal> {
    35 
    45 
    36   // Counts total words committed for metaspace
    46   // Counts total words committed for metaspace
    37   SizeCounter _cnt;
    47   SizeCounter _cnt;
    38 
    48