< prev index next >

src/hotspot/share/services/memoryPool.hpp

Print this page
rev 47884 : 8191564: Refactor GC related servicability code into GC specific subclasses
   1 /*
   2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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  *


 160   MemoryUsage get_memory_usage();
 161   size_t used_in_bytes();
 162 };
 163 
 164 class SurvivorContiguousSpacePool : public CollectedMemoryPool {
 165 private:
 166   DefNewGeneration* _young_gen;
 167 
 168 public:
 169   SurvivorContiguousSpacePool(DefNewGeneration* young_gen,
 170                               const char* name,
 171                               PoolType type,
 172                               size_t max_size,
 173                               bool support_usage_threshold);
 174 
 175   MemoryUsage get_memory_usage();
 176 
 177   size_t used_in_bytes();
 178   size_t committed_in_bytes();
 179 };
 180 
 181 #if INCLUDE_ALL_GCS
 182 class CompactibleFreeListSpacePool : public CollectedMemoryPool {
 183 private:
 184   CompactibleFreeListSpace* _space;
 185 public:
 186   CompactibleFreeListSpacePool(CompactibleFreeListSpace* space,
 187                                const char* name,
 188                                PoolType type,
 189                                size_t max_size,
 190                                bool support_usage_threshold);
 191 
 192   MemoryUsage get_memory_usage();
 193   size_t used_in_bytes();
 194 };
 195 #endif // INCLUDE_ALL_GCS
 196 
 197 
 198 class GenerationPool : public CollectedMemoryPool {
 199 private:
 200   Generation* _gen;
 201 public:
 202   GenerationPool(Generation* gen, const char* name, PoolType type, bool support_usage_threshold);
 203 
 204   MemoryUsage get_memory_usage();
 205   size_t used_in_bytes();
 206 };
 207 
 208 class CodeHeapPool: public MemoryPool {
 209 private:
 210   CodeHeap* _codeHeap;
 211 public:
 212   CodeHeapPool(CodeHeap* codeHeap, const char* name, bool support_usage_threshold);
 213   MemoryUsage get_memory_usage();
 214   size_t used_in_bytes()            { return _codeHeap->allocated_capacity(); }
 215 };
   1 /*
   2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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  *


 160   MemoryUsage get_memory_usage();
 161   size_t used_in_bytes();
 162 };
 163 
 164 class SurvivorContiguousSpacePool : public CollectedMemoryPool {
 165 private:
 166   DefNewGeneration* _young_gen;
 167 
 168 public:
 169   SurvivorContiguousSpacePool(DefNewGeneration* young_gen,
 170                               const char* name,
 171                               PoolType type,
 172                               size_t max_size,
 173                               bool support_usage_threshold);
 174 
 175   MemoryUsage get_memory_usage();
 176 
 177   size_t used_in_bytes();
 178   size_t committed_in_bytes();
 179 };
















 180 
 181 
 182 class GenerationPool : public CollectedMemoryPool {
 183 private:
 184   Generation* _gen;
 185 public:
 186   GenerationPool(Generation* gen, const char* name, PoolType type, bool support_usage_threshold);
 187 
 188   MemoryUsage get_memory_usage();
 189   size_t used_in_bytes();
 190 };
 191 
 192 class CodeHeapPool: public MemoryPool {
 193 private:
 194   CodeHeap* _codeHeap;
 195 public:
 196   CodeHeapPool(CodeHeap* codeHeap, const char* name, bool support_usage_threshold);
 197   MemoryUsage get_memory_usage();
 198   size_t used_in_bytes()            { return _codeHeap->allocated_capacity(); }
 199 };
< prev index next >