< prev index next >

src/share/vm/services/virtualMemoryTracker.hpp

Print this page
rev 9024 : 8218558: NMT stack traces in output should show mt component for virtual memory allocations
Reviewed-by: shade, stuefe, coleenp


  52     assert(_committed <= _reserved, "Sanity check");
  53   }
  54 
  55   inline void release_memory (size_t sz) {
  56     assert(_reserved >= sz, "Negative amount");
  57     _reserved -= sz;
  58   }
  59 
  60   inline void uncommit_memory(size_t sz) {
  61     assert(_committed >= sz, "Negative amount");
  62     _committed -= sz;
  63   }
  64 
  65   inline size_t reserved()  const { return _reserved;  }
  66   inline size_t committed() const { return _committed; }
  67 };
  68 
  69 // Virtual memory allocation site, keeps track where the virtual memory is reserved.
  70 class VirtualMemoryAllocationSite : public AllocationSite<VirtualMemory> {
  71  public:
  72   VirtualMemoryAllocationSite(const NativeCallStack& stack) :
  73     AllocationSite<VirtualMemory>(stack) { }
  74 
  75   inline void reserve_memory(size_t sz)  { data()->reserve_memory(sz);  }
  76   inline void commit_memory (size_t sz)  { data()->commit_memory(sz);   }
  77   inline void uncommit_memory(size_t sz) { data()->uncommit_memory(sz); }
  78   inline void release_memory(size_t sz)  { data()->release_memory(sz);  }
  79   inline size_t reserved() const  { return peek()->reserved(); }
  80   inline size_t committed() const { return peek()->committed(); }
  81 };
  82 
  83 class VirtualMemorySummary;
  84 
  85 // This class represents a snapshot of virtual memory at a given time.
  86 // The latest snapshot is saved in a static area.
  87 class VirtualMemorySnapshot : public ResourceObj {
  88   friend class VirtualMemorySummary;
  89 
  90  private:
  91   VirtualMemory  _virtual_memory[mt_number_of_types];
  92 
  93  public:




  52     assert(_committed <= _reserved, "Sanity check");
  53   }
  54 
  55   inline void release_memory (size_t sz) {
  56     assert(_reserved >= sz, "Negative amount");
  57     _reserved -= sz;
  58   }
  59 
  60   inline void uncommit_memory(size_t sz) {
  61     assert(_committed >= sz, "Negative amount");
  62     _committed -= sz;
  63   }
  64 
  65   inline size_t reserved()  const { return _reserved;  }
  66   inline size_t committed() const { return _committed; }
  67 };
  68 
  69 // Virtual memory allocation site, keeps track where the virtual memory is reserved.
  70 class VirtualMemoryAllocationSite : public AllocationSite<VirtualMemory> {
  71  public:
  72   VirtualMemoryAllocationSite(const NativeCallStack& stack, MEMFLAGS flag) :
  73     AllocationSite<VirtualMemory>(stack, flag) { }
  74 
  75   inline void reserve_memory(size_t sz)  { data()->reserve_memory(sz);  }
  76   inline void commit_memory (size_t sz)  { data()->commit_memory(sz);   }
  77   inline void uncommit_memory(size_t sz) { data()->uncommit_memory(sz); }
  78   inline void release_memory(size_t sz)  { data()->release_memory(sz);  }
  79   inline size_t reserved() const  { return peek()->reserved(); }
  80   inline size_t committed() const { return peek()->committed(); }
  81 };
  82 
  83 class VirtualMemorySummary;
  84 
  85 // This class represents a snapshot of virtual memory at a given time.
  86 // The latest snapshot is saved in a static area.
  87 class VirtualMemorySnapshot : public ResourceObj {
  88   friend class VirtualMemorySummary;
  89 
  90  private:
  91   VirtualMemory  _virtual_memory[mt_number_of_types];
  92 
  93  public:


< prev index next >