1 /*
   2  * Copyright (c) 2014, 2019, 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  *
  23  */
  24 
  25 #ifndef SHARE_MEMORY_METASPACECHUNKFREELISTSUMMARY_HPP
  26 #define SHARE_MEMORY_METASPACECHUNKFREELISTSUMMARY_HPP
  27 
  28 #include "utilities/globalDefinitions.hpp"
  29 
  30 // Todo: will need to rework this, see JDK-8251342
  31 class MetaspaceChunkFreeListSummary {
  32   size_t _num_specialized_chunks;
  33   size_t _num_small_chunks;
  34   size_t _num_medium_chunks;
  35   size_t _num_humongous_chunks;
  36 
  37   size_t _specialized_chunks_size_in_bytes;
  38   size_t _small_chunks_size_in_bytes;
  39   size_t _medium_chunks_size_in_bytes;
  40   size_t _humongous_chunks_size_in_bytes;
  41 
  42  public:
  43   MetaspaceChunkFreeListSummary() :
  44     _num_specialized_chunks(0),
  45     _num_small_chunks(0),
  46     _num_medium_chunks(0),
  47     _num_humongous_chunks(0),
  48     _specialized_chunks_size_in_bytes(0),
  49     _small_chunks_size_in_bytes(0),
  50     _medium_chunks_size_in_bytes(0),
  51     _humongous_chunks_size_in_bytes(0)
  52   {}
  53 
  54   MetaspaceChunkFreeListSummary(size_t num_specialized_chunks,
  55                                 size_t num_small_chunks,
  56                                 size_t num_medium_chunks,
  57                                 size_t num_humongous_chunks,
  58                                 size_t specialized_chunks_size_in_bytes,
  59                                 size_t small_chunks_size_in_bytes,
  60                                 size_t medium_chunks_size_in_bytes,
  61                                 size_t humongous_chunks_size_in_bytes) :
  62     _num_specialized_chunks(num_specialized_chunks),
  63     _num_small_chunks(num_small_chunks),
  64     _num_medium_chunks(num_medium_chunks),
  65     _num_humongous_chunks(num_humongous_chunks),
  66     _specialized_chunks_size_in_bytes(specialized_chunks_size_in_bytes),
  67     _small_chunks_size_in_bytes(small_chunks_size_in_bytes),
  68     _medium_chunks_size_in_bytes(medium_chunks_size_in_bytes),
  69     _humongous_chunks_size_in_bytes(humongous_chunks_size_in_bytes)
  70   {}
  71 
  72   size_t num_specialized_chunks() const {
  73     return _num_specialized_chunks;
  74   }
  75 
  76   size_t num_small_chunks() const {
  77     return _num_small_chunks;
  78   }
  79 
  80   size_t num_medium_chunks() const {
  81     return _num_medium_chunks;
  82   }
  83 
  84   size_t num_humongous_chunks() const {
  85     return _num_humongous_chunks;
  86   }
  87 
  88   size_t specialized_chunks_size_in_bytes() const {
  89     return _specialized_chunks_size_in_bytes;
  90   }
  91 
  92   size_t small_chunks_size_in_bytes() const {
  93     return _small_chunks_size_in_bytes;
  94   }
  95 
  96   size_t medium_chunks_size_in_bytes() const {
  97     return _medium_chunks_size_in_bytes;
  98   }
  99 
 100   size_t humongous_chunks_size_in_bytes() const {
 101     return _humongous_chunks_size_in_bytes;
 102   }
 103 };
 104 
 105 #endif // SHARE_MEMORY_METASPACECHUNKFREELISTSUMMARY_HPP