memBaseline.cpp revision 4066
4449N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 4449N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4449N/A * This code is free software; you can redistribute it and/or modify it 4449N/A * under the terms of the GNU General Public License version 2 only, as 4449N/A * published by the Free Software Foundation. 4449N/A * This code is distributed in the hope that it will be useful, but WITHOUT 4449N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4449N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4449N/A * version 2 for more details (a copy is included in the LICENSE file that 4449N/A * You should have received a copy of the GNU General Public License version 4449N/A * 2 along with this work; if not, write to the Free Software Foundation, 4449N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4449N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4449N/A {
mtNone,
"Unknown"}
// It can happen when type tagging records are lagging // baseline malloc'd memory records, generate overall summary and summaries by // We do have anonymous arenas, they are either used as value objects, // which are embedded inside other objects, or used as stack objects. // see if arena memory record present "Arena records do not match");
// substract used arena size to get size of arena chunk in free list // we really don't know how many chunks in free list, so just set to // baseline mmap'd memory records, generate overall summary and summaries by // we use the number of thread stack to count threads // baseline malloc'd memory by callsites, but only the callsites with memory allocation // initailize malloc callsite array // sort into callsite pc order. Details are aggregated by callsites // baseline memory that is totaled over 1 KB // restore to address order. Snapshot malloc data is maintained in memory // baseline mmap'd memory by callsites // initialize virtual memory map array // initialize virtual memory callsite array // consolidate virtual memory data // vm_ptr is coming in increasing base address order // consolidate reserved memory regions for virtual memory map. // The criteria for consolidation is: // 1. two adjacent reserved memory regions // 2. belong to the same memory type // 3. reserved from the same callsite // inserted reserved region, we need the pointer to the element in virtual // consolidate committed memory regions for virtual memory map // 1. two adjacent committed memory regions // 2. committed from the same callsite // sort it into callsite pc order. Details are aggregated by callsites // walk the array to consolidate record by pc // baseline a snapshot. If summary_only = false, memory usages aggregated by // callsites are also baselined. "not properly baselined");
/* compare functions for sorting */ // sort snapshot malloc'd records in callsite pc order // sort baselined malloc'd records in size order // sort baselined malloc'd records in callsite pc order // sort baselined mmap'd records in size (reserved size) order // sort baselined mmap'd records in callsite pc order // sort snapshot malloc'd records in memory block address order