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