memSnapshot.hpp revision 4068
0N/A * Copyright (c) 2012, 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// Snapshot pointer array iterator 0N/A// The pointer array contains malloc-ed pointers 0N/A // locate an existing reserved memory region that contains specified address, 0N/A // or the reserved region just above this address, where the incoming 0N/A // reserved region should be inserted. 0N/A // following methods update virtual memory in the context 0N/A // of 'current' position, which is properly positioned by 0N/A // callers via locate method. 0N/A // split a reserved region to create a new memory region with specified base and size 0N/A // reset current position 0N/A // check integrity of records on current reserved memory region. 0N/A // all committed regions that follow current reserved region, should all 0N/A // belong to the reserved region. 0N/A // arena memory record is a special case, which we have to compare 0N/A // sequence number against its associated arena record. 0N/A // if there is an associated arena record, it has to be previous 0N/A // record because of sorting order (by address) - NMT generates a pseudo address 0N/A // for arena's size record by offsetting arena's address, that guarantees 0N/A // the order of arena record and it's size record. 0N/A // Skip this arena memory record 0N/A // - if the arena record is an allocation record, this early 0N/A // size record must be leftover by previous arena, 0N/A // and the last size record should have size = 0. 0N/A // - if the arena record is a deallocation record, this 0N/A // size record should be its cleanup record, which should 0N/A // also have size = 0. In other world, arena alway reset 0N/A // its size before gone (see Arena's destructor) 0N/A "Arena size record ahead of allocation record");
0N/A// collapse duplicated records. Eliminating duplicated records here, is much 0N/A// cheaper than during promotion phase. However, it does have limitation - it 0N/A// can only eliminate duplicated records within the generation, there are 0N/A// still chances seeing duplicated records during promotion. 0N/A// We want to use the record with higher sequence number, because it has 0N/A// more accurate callsite pc. 0N/A // get next record, but skip the duplicated records 0N/A // the following two arrays contain records of all known lived memory blocks 0N/A // live malloc-ed memory pointers 0N/A // live virtual memory pointers 0N/A // the lock to protect this snapshot 0N/A // if we are running out of native memory // merge a per-thread memory recorder into staging area // promote staged data to snapshot // dump all virtual memory pointers in snapshot // copy sequenced pointer from src to dest // assign a sequenced pointer to non-sequenced pointer #
endif // SHARE_VM_SERVICES_MEM_SNAPSHOT_HPP