hotspot/src/share/vm/memory/permGen.hpp
changeset 6765 f8d7d46aa4ff
parent 5547 f4b087cbb361
child 7397 5b173b4ca846
equal deleted inserted replaced
6764:82eecb6073ad 6765:f8d7d46aa4ff
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    28 
    28 
    29 class Generation;
    29 class Generation;
    30 class GenRemSet;
    30 class GenRemSet;
    31 class CSpaceCounters;
    31 class CSpaceCounters;
    32 
    32 
    33 // PermGen models the part of the heap
    33 // PermGen models the part of the heap used to allocate class meta-data.
    34 
    34 
    35 class PermGen : public CHeapObj {
    35 class PermGen : public CHeapObj {
    36   friend class VMStructs;
    36   friend class VMStructs;
    37  protected:
    37  protected:
    38   size_t _capacity_expansion_limit;  // maximum expansion allowed without a
    38   size_t _capacity_expansion_limit;  // maximum expansion allowed without a
    39                                      // full gc occurring
    39                                      // full gc occurring
       
    40   void set_capacity_expansion_limit(size_t limit) {
       
    41     assert_locked_or_safepoint(Heap_lock);
       
    42     _capacity_expansion_limit = limit;
       
    43   }
    40 
    44 
    41   HeapWord* mem_allocate_in_gen(size_t size, Generation* gen);
    45   HeapWord* mem_allocate_in_gen(size_t size, Generation* gen);
       
    46   // Along with mem_allocate_in_gen() above, implements policy for
       
    47   // "scheduling" allocation/expansion/collection of the perm gen.
       
    48   // The virtual method request_...() below can be overridden by
       
    49   // subtypes that want to implement a different expansion/collection
       
    50   // policy from the default provided.
       
    51   virtual HeapWord* request_expand_and_allocate(Generation* gen, size_t size,
       
    52                                                 GCCause::Cause prev_cause);
    42 
    53 
    43  public:
    54  public:
    44   enum Name {
    55   enum Name {
    45     MarkSweepCompact, MarkSweep, ConcurrentMarkSweep
    56     MarkSweepCompact, MarkSweep, ConcurrentMarkSweep
    46   };
    57   };