< prev index next >

src/hotspot/share/services/virtualMemoryTracker.hpp

Print this page
rev 60538 : imported patch jep387-misc.patch


 385   static bool remove_released_region    (ReservedMemoryRegion* rgn);
 386   static void set_reserved_region_type  (address addr, MEMFLAGS flag);
 387 
 388   // Given an existing memory mapping registered with NMT, split the mapping in
 389   //  two. The newly created two mappings will be registered under the call
 390   //  stack and the memory flags of the original section.
 391   static bool split_reserved_region(address addr, size_t size, size_t split);
 392 
 393   // Walk virtual memory data structure for creating baseline, etc.
 394   static bool walk_virtual_memory(VirtualMemoryWalker* walker);
 395 
 396   static bool transition(NMT_TrackingLevel from, NMT_TrackingLevel to);
 397 
 398   // Snapshot current thread stacks
 399   static void snapshot_thread_stacks();
 400 
 401  private:
 402   static SortedLinkedList<ReservedMemoryRegion, compare_reserved_region_base>* _reserved_regions;
 403 };
 404 
 405 
 406 class MetaspaceSnapshot : public ResourceObj {
 407 private:
 408   size_t  _reserved_in_bytes[Metaspace::MetadataTypeCount];
 409   size_t  _committed_in_bytes[Metaspace::MetadataTypeCount];
 410   size_t  _used_in_bytes[Metaspace::MetadataTypeCount];
 411   size_t  _free_in_bytes[Metaspace::MetadataTypeCount];
 412 
 413 public:
 414   MetaspaceSnapshot();
 415   size_t reserved_in_bytes(Metaspace::MetadataType type)   const { assert_valid_metadata_type(type); return _reserved_in_bytes[type]; }
 416   size_t committed_in_bytes(Metaspace::MetadataType type)  const { assert_valid_metadata_type(type); return _committed_in_bytes[type]; }
 417   size_t used_in_bytes(Metaspace::MetadataType type)       const { assert_valid_metadata_type(type); return _used_in_bytes[type]; }
 418   size_t free_in_bytes(Metaspace::MetadataType type)       const { assert_valid_metadata_type(type); return _free_in_bytes[type]; }
 419 
 420   static void snapshot(MetaspaceSnapshot& s);
 421 
 422 private:
 423   static void snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& s);
 424 
 425   static void assert_valid_metadata_type(Metaspace::MetadataType type) {


 385   static bool remove_released_region    (ReservedMemoryRegion* rgn);
 386   static void set_reserved_region_type  (address addr, MEMFLAGS flag);
 387 
 388   // Given an existing memory mapping registered with NMT, split the mapping in
 389   //  two. The newly created two mappings will be registered under the call
 390   //  stack and the memory flags of the original section.
 391   static bool split_reserved_region(address addr, size_t size, size_t split);
 392 
 393   // Walk virtual memory data structure for creating baseline, etc.
 394   static bool walk_virtual_memory(VirtualMemoryWalker* walker);
 395 
 396   static bool transition(NMT_TrackingLevel from, NMT_TrackingLevel to);
 397 
 398   // Snapshot current thread stacks
 399   static void snapshot_thread_stacks();
 400 
 401  private:
 402   static SortedLinkedList<ReservedMemoryRegion, compare_reserved_region_base>* _reserved_regions;
 403 };
 404 
 405 // Todo: clean up after jep387, see JDK-8251392
 406 class MetaspaceSnapshot : public ResourceObj {
 407 private:
 408   size_t  _reserved_in_bytes[Metaspace::MetadataTypeCount];
 409   size_t  _committed_in_bytes[Metaspace::MetadataTypeCount];
 410   size_t  _used_in_bytes[Metaspace::MetadataTypeCount];
 411   size_t  _free_in_bytes[Metaspace::MetadataTypeCount];
 412 
 413 public:
 414   MetaspaceSnapshot();
 415   size_t reserved_in_bytes(Metaspace::MetadataType type)   const { assert_valid_metadata_type(type); return _reserved_in_bytes[type]; }
 416   size_t committed_in_bytes(Metaspace::MetadataType type)  const { assert_valid_metadata_type(type); return _committed_in_bytes[type]; }
 417   size_t used_in_bytes(Metaspace::MetadataType type)       const { assert_valid_metadata_type(type); return _used_in_bytes[type]; }
 418   size_t free_in_bytes(Metaspace::MetadataType type)       const { assert_valid_metadata_type(type); return _free_in_bytes[type]; }
 419 
 420   static void snapshot(MetaspaceSnapshot& s);
 421 
 422 private:
 423   static void snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& s);
 424 
 425   static void assert_valid_metadata_type(Metaspace::MetadataType type) {
< prev index next >