src/share/vm/services/memBaseline.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/services/memBaseline.hpp

src/share/vm/services/memBaseline.hpp

Print this page

        

*** 59,124 **** by_size, // by memory size by_site // by call site where the memory is allocated from }; private: - // All baseline data is stored in this arena - Arena* _arena; - // Summary information ! MallocMemorySnapshot* _malloc_memory_snapshot; ! VirtualMemorySnapshot* _virtual_memory_snapshot; size_t _class_count; // Allocation sites information // Malloc allocation sites ! LinkedListImpl<MallocSite, ResourceObj::ARENA> ! _malloc_sites; // All virtual memory allocations ! LinkedListImpl<ReservedMemoryRegion, ResourceObj::ARENA> ! _virtual_memory_allocations; // Virtual memory allocations by allocation sites, always in by_address // order ! LinkedListImpl<VirtualMemoryAllocationSite, ResourceObj::ARENA> ! _virtual_memory_sites; SortingOrder _malloc_sites_order; SortingOrder _virtual_memory_sites_order; BaselineType _baseline_type; public: // create a memory baseline MemBaseline(): _baseline_type(Not_baselined), ! _class_count(0), ! _arena(NULL), ! _malloc_memory_snapshot(NULL), ! _virtual_memory_snapshot(NULL), ! _malloc_sites(NULL) { } ~MemBaseline() { reset(); - if (_arena != NULL) { - delete _arena; - } } bool baseline(bool summaryOnly = true); BaselineType baseline_type() const { return _baseline_type; } ! MallocMemorySnapshot* malloc_memory_snapshot() const { ! return _malloc_memory_snapshot; } ! VirtualMemorySnapshot* virtual_memory_snapshot() const { ! return _virtual_memory_snapshot; } MallocSiteIterator malloc_sites(SortingOrder order); VirtualMemorySiteIterator virtual_memory_sites(SortingOrder order); --- 59,111 ---- by_size, // by memory size by_site // by call site where the memory is allocated from }; private: // Summary information ! MallocMemorySnapshot _malloc_memory_snapshot; ! VirtualMemorySnapshot _virtual_memory_snapshot; size_t _class_count; // Allocation sites information // Malloc allocation sites ! LinkedListImpl<MallocSite> _malloc_sites; // All virtual memory allocations ! LinkedListImpl<ReservedMemoryRegion> _virtual_memory_allocations; // Virtual memory allocations by allocation sites, always in by_address // order ! LinkedListImpl<VirtualMemoryAllocationSite> _virtual_memory_sites; SortingOrder _malloc_sites_order; SortingOrder _virtual_memory_sites_order; BaselineType _baseline_type; public: // create a memory baseline MemBaseline(): _baseline_type(Not_baselined), ! _class_count(0) { } ~MemBaseline() { reset(); } bool baseline(bool summaryOnly = true); BaselineType baseline_type() const { return _baseline_type; } ! MallocMemorySnapshot* malloc_memory_snapshot() { ! return &_malloc_memory_snapshot; } ! VirtualMemorySnapshot* virtual_memory_snapshot() { ! return &_virtual_memory_snapshot; } MallocSiteIterator malloc_sites(SortingOrder order); VirtualMemorySiteIterator virtual_memory_sites(SortingOrder order);
*** 131,205 **** // Total reserved memory = total malloc'd memory + total reserved virtual // memory size_t total_reserved_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! assert(_virtual_memory_snapshot != NULL, "No virtual memory snapshot"); ! assert(_malloc_memory_snapshot != NULL, "No malloc memory snapshot"); ! size_t amount = _malloc_memory_snapshot->total() + ! _virtual_memory_snapshot->total_reserved(); return amount; } // Total committed memory = total malloc'd memory + total committed // virtual memory size_t total_committed_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! assert(_virtual_memory_snapshot != NULL, ! "Not a snapshot"); ! size_t amount = _malloc_memory_snapshot->total() + ! _virtual_memory_snapshot->total_committed(); return amount; } size_t total_arena_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! assert(_malloc_memory_snapshot != NULL, "Not yet baselined"); ! return _malloc_memory_snapshot->total_arena(); } size_t malloc_tracking_overhead() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! return _malloc_memory_snapshot->malloc_overhead()->size(); } ! const MallocMemory* malloc_memory(MEMFLAGS flag) const { ! assert(_malloc_memory_snapshot != NULL, "Not a snapshot"); ! return _malloc_memory_snapshot->by_type(flag); } ! const VirtualMemory* virtual_memory(MEMFLAGS flag) const { ! assert(_virtual_memory_snapshot != NULL, "Not a snapshot"); ! return _virtual_memory_snapshot->by_type(flag); } size_t class_count() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); return _class_count; } size_t thread_count() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! assert(_malloc_memory_snapshot != NULL, "Baselined?"); ! return _malloc_memory_snapshot->thread_count(); } // reset the baseline for reuse void reset() { _baseline_type = Not_baselined; ! _malloc_memory_snapshot = NULL; ! _virtual_memory_snapshot = NULL; _class_count = 0; ! _malloc_sites = NULL; ! _virtual_memory_sites = NULL; ! _virtual_memory_allocations = NULL; ! ! if (_arena != NULL) { ! _arena->destruct_contents(); ! } } private: // Baseline summary information bool baseline_summary(); --- 118,183 ---- // Total reserved memory = total malloc'd memory + total reserved virtual // memory size_t total_reserved_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! size_t amount = _malloc_memory_snapshot.total() + ! _virtual_memory_snapshot.total_reserved(); return amount; } // Total committed memory = total malloc'd memory + total committed // virtual memory size_t total_committed_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! size_t amount = _malloc_memory_snapshot.total() + ! _virtual_memory_snapshot.total_committed(); return amount; } size_t total_arena_memory() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! return _malloc_memory_snapshot.total_arena(); } size_t malloc_tracking_overhead() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! MemBaseline* bl = const_cast<MemBaseline*>(this); ! return bl->_malloc_memory_snapshot.malloc_overhead()->size(); } ! MallocMemory* malloc_memory(MEMFLAGS flag) { ! assert(baseline_type() != Not_baselined, "Not yet baselined"); ! return _malloc_memory_snapshot.by_type(flag); } ! VirtualMemory* virtual_memory(MEMFLAGS flag) { ! assert(baseline_type() != Not_baselined, "Not yet baselined"); ! return _virtual_memory_snapshot.by_type(flag); } size_t class_count() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); return _class_count; } size_t thread_count() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); ! return _malloc_memory_snapshot.thread_count(); } // reset the baseline for reuse void reset() { _baseline_type = Not_baselined; ! _malloc_memory_snapshot.reset(); ! _virtual_memory_snapshot.reset(); _class_count = 0; ! _malloc_sites.clear(); ! _virtual_memory_sites.clear(); ! _virtual_memory_allocations.clear(); } private: // Baseline summary information bool baseline_summary();
*** 208,219 **** bool baseline_allocation_sites(); // Aggregate virtual memory allocation by allocation sites bool aggregate_virtual_memory_allocation_sites(); - Arena* arena() { return _arena; } - // Sorting allocation sites in different orders // Sort allocation sites in size order void malloc_sites_to_size_order(); // Sort allocation sites in call site address order void malloc_sites_to_allocation_site_order(); --- 186,195 ----
src/share/vm/services/memBaseline.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File