src/hotspot/share/gc/shared/preGCValues.hpp
changeset 57662 f81dbe27a7b1
equal deleted inserted replaced
57661:5cc8f9225a6d 57662:f81dbe27a7b1
       
     1 /*
       
     2  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
       
     3  * Copyright (c) 2019, Twitter, Inc.
       
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     5  *
       
     6  * This code is free software; you can redistribute it and/or modify it
       
     7  * under the terms of the GNU General Public License version 2 only, as
       
     8  * published by the Free Software Foundation.
       
     9  *
       
    10  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    13  * version 2 for more details (a copy is included in the LICENSE file that
       
    14  * accompanied this code).
       
    15  *
       
    16  * You should have received a copy of the GNU General Public License version
       
    17  * 2 along with this work; if not, write to the Free Software Foundation,
       
    18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    19  *
       
    20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    21  * or visit www.oracle.com if you need additional information or have any
       
    22  * questions.
       
    23  *
       
    24  */
       
    25 
       
    26 #ifndef SHARE_GC_SHARED_PREGCVALUES_HPP
       
    27 #define SHARE_GC_SHARED_PREGCVALUES_HPP
       
    28 
       
    29 #include "memory/metaspace/metaspaceSizesSnapshot.hpp"
       
    30 
       
    31 // Simple class for storing info about the heap at the start of GC, to be used
       
    32 // after GC for comparison/printing.
       
    33 class PreGenGCValues {
       
    34 public:
       
    35   PreGenGCValues(size_t young_gen_used,
       
    36                  size_t young_gen_capacity,
       
    37                  size_t eden_used,
       
    38                  size_t eden_capacity,
       
    39                  size_t from_used,
       
    40                  size_t from_capacity,
       
    41                  size_t old_gen_used,
       
    42                  size_t old_gen_capacity)
       
    43       : _young_gen_used(young_gen_used),
       
    44         _young_gen_capacity(young_gen_capacity),
       
    45         _eden_used(eden_used),
       
    46         _eden_capacity(eden_capacity),
       
    47         _from_used(from_used),
       
    48         _from_capacity(from_capacity),
       
    49         _old_gen_used(old_gen_used),
       
    50         _old_gen_capacity(old_gen_capacity) { }
       
    51 
       
    52   size_t young_gen_used()     const { return _young_gen_used;     }
       
    53   size_t young_gen_capacity() const { return _young_gen_capacity; }
       
    54   size_t eden_used()          const { return _eden_used;          }
       
    55   size_t eden_capacity()      const { return _eden_capacity;      }
       
    56   size_t from_used()          const { return _from_used;          }
       
    57   size_t from_capacity()      const { return _from_capacity;      }
       
    58   size_t old_gen_used()       const { return _old_gen_used;       }
       
    59   size_t old_gen_capacity()   const { return _old_gen_capacity;   }
       
    60   const metaspace::MetaspaceSizesSnapshot& metaspace_sizes() const { return _meta_sizes; }
       
    61 
       
    62 private:
       
    63   const size_t _young_gen_used;
       
    64   const size_t _young_gen_capacity;
       
    65   const size_t _eden_used;
       
    66   const size_t _eden_capacity;
       
    67   const size_t _from_used;
       
    68   const size_t _from_capacity;
       
    69   const size_t _old_gen_used;
       
    70   const size_t _old_gen_capacity;
       
    71   const metaspace::MetaspaceSizesSnapshot _meta_sizes;
       
    72 };
       
    73 
       
    74 #endif // SHARE_GC_SHARED_PREGCVALUES_HPP