< prev index next >

src/hotspot/share/memory/metaspaceShared.hpp

Print this page


  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_METASPACESHARED_HPP
  26 #define SHARE_MEMORY_METASPACESHARED_HPP
  27 
  28 #include "classfile/compactHashtable.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "memory/memRegion.hpp"
  31 #include "memory/virtualspace.hpp"
  32 #include "oops/oop.hpp"
  33 #include "utilities/exceptions.hpp"
  34 #include "utilities/macros.hpp"
  35 #include "utilities/resourceHash.hpp"
  36 
  37 #define MAX_SHARED_DELTA                (0x7FFFFFFF)
  38 
  39 class outputStream;
  40 class FileMapInfo;
  41 class CHeapBitMap;
  42 struct ArchiveHeapOopmapInfo;
  43 
  44 enum MapArchiveResult {
  45   MAP_ARCHIVE_SUCCESS,
  46   MAP_ARCHIVE_MMAP_FAILURE,
  47   MAP_ARCHIVE_OTHER_FAILURE
  48 };
  49 
  50 class MetaspaceSharedStats {
  51 public:
  52   MetaspaceSharedStats() {
  53     memset(this, 0, sizeof(*this));


 196     num_non_heap_spaces = 4,
 197 
 198     // mapped java heap regions
 199     first_closed_archive_heap_region = bm + 1,
 200     max_closed_archive_heap_region = 2,
 201     last_closed_archive_heap_region = first_closed_archive_heap_region + max_closed_archive_heap_region - 1,
 202     first_open_archive_heap_region = last_closed_archive_heap_region + 1,
 203     max_open_archive_heap_region = 2,
 204     last_open_archive_heap_region = first_open_archive_heap_region + max_open_archive_heap_region - 1,
 205 
 206     last_valid_region = last_open_archive_heap_region,
 207     n_regions =  last_valid_region + 1 // total number of regions
 208   };
 209 
 210   static void prepare_for_dumping() NOT_CDS_RETURN;
 211   static void preload_and_dump(TRAPS) NOT_CDS_RETURN;
 212   static int preload_classes(const char * class_list_path,
 213                              TRAPS) NOT_CDS_RETURN_(0);
 214 
 215   static GrowableArray<Klass*>* collected_klasses();
 216   static GrowableArray<Symbol*>* collected_symbols();
 217   static void add_symbol(Symbol* sym) NOT_CDS_RETURN;
 218 
 219   static ReservedSpace* shared_rs() {
 220     CDS_ONLY(return &_shared_rs);
 221     NOT_CDS(return NULL);
 222   }
 223 
 224   static Symbol* symbol_rs_base() {
 225     return (Symbol*)_symbol_rs.base();
 226   }
 227 
 228   static void set_shared_rs(ReservedSpace rs) {
 229     CDS_ONLY(_shared_rs = rs);
 230   }
 231 
 232   static void commit_to(ReservedSpace* rs, VirtualSpace* vs, char* newtop) NOT_CDS_RETURN;
 233   static void initialize_dumptime_shared_and_meta_spaces() NOT_CDS_RETURN;
 234   static void initialize_runtime_shared_and_meta_spaces() NOT_CDS_RETURN;
 235   static void post_initialize(TRAPS) NOT_CDS_RETURN;
 236 
 237   static void print_on(outputStream* st);




  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_METASPACESHARED_HPP
  26 #define SHARE_MEMORY_METASPACESHARED_HPP
  27 
  28 #include "classfile/compactHashtable.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "memory/memRegion.hpp"
  31 #include "memory/virtualspace.hpp"
  32 #include "oops/oop.hpp"

  33 #include "utilities/macros.hpp"
  34 #include "utilities/resourceHash.hpp"
  35 
  36 #define MAX_SHARED_DELTA                (0x7FFFFFFF)
  37 
  38 class outputStream;
  39 class FileMapInfo;
  40 class CHeapBitMap;
  41 struct ArchiveHeapOopmapInfo;
  42 
  43 enum MapArchiveResult {
  44   MAP_ARCHIVE_SUCCESS,
  45   MAP_ARCHIVE_MMAP_FAILURE,
  46   MAP_ARCHIVE_OTHER_FAILURE
  47 };
  48 
  49 class MetaspaceSharedStats {
  50 public:
  51   MetaspaceSharedStats() {
  52     memset(this, 0, sizeof(*this));


 195     num_non_heap_spaces = 4,
 196 
 197     // mapped java heap regions
 198     first_closed_archive_heap_region = bm + 1,
 199     max_closed_archive_heap_region = 2,
 200     last_closed_archive_heap_region = first_closed_archive_heap_region + max_closed_archive_heap_region - 1,
 201     first_open_archive_heap_region = last_closed_archive_heap_region + 1,
 202     max_open_archive_heap_region = 2,
 203     last_open_archive_heap_region = first_open_archive_heap_region + max_open_archive_heap_region - 1,
 204 
 205     last_valid_region = last_open_archive_heap_region,
 206     n_regions =  last_valid_region + 1 // total number of regions
 207   };
 208 
 209   static void prepare_for_dumping() NOT_CDS_RETURN;
 210   static void preload_and_dump(TRAPS) NOT_CDS_RETURN;
 211   static int preload_classes(const char * class_list_path,
 212                              TRAPS) NOT_CDS_RETURN_(0);
 213 
 214   static GrowableArray<Klass*>* collected_klasses();


 215 
 216   static ReservedSpace* shared_rs() {
 217     CDS_ONLY(return &_shared_rs);
 218     NOT_CDS(return NULL);
 219   }
 220 
 221   static Symbol* symbol_rs_base() {
 222     return (Symbol*)_symbol_rs.base();
 223   }
 224 
 225   static void set_shared_rs(ReservedSpace rs) {
 226     CDS_ONLY(_shared_rs = rs);
 227   }
 228 
 229   static void commit_to(ReservedSpace* rs, VirtualSpace* vs, char* newtop) NOT_CDS_RETURN;
 230   static void initialize_dumptime_shared_and_meta_spaces() NOT_CDS_RETURN;
 231   static void initialize_runtime_shared_and_meta_spaces() NOT_CDS_RETURN;
 232   static void post_initialize(TRAPS) NOT_CDS_RETURN;
 233 
 234   static void print_on(outputStream* st);


< prev index next >