/* * Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2019 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
public: enum compType {
noComp = 0, // must be! due to initialization by memset to zero
c1,
c2,
jvmci,
lastComp
};
enum blobType {
noType = 0, // must be! due to initialization by memset to zero // The nMethod_* values correspond to the CompiledMethod enum values. // We can't use the CompiledMethod values 1:1 because we depend on noType == 0.
nMethod_inconstruction, // under construction. Very soon, the type will transition to "in_use". // can't be observed while holding Compile_lock and CodeCache_lock simultaneously. // left in here for completeness (and to document we spent a thought).
nMethod_inuse, // executable. This is the "normal" state for a nmethod.
nMethod_notused, // assumed inactive, marked not entrant. Could be revived if necessary.
nMethod_notentrant, // no new activations allowed, marked for deoptimization. Old activations may still exist.
runtimeStub,
ricochetStub,
deoptimizationStub,
uncommonTrapStub,
exceptionStub,
safepointStub,
adapterBlob,
mh_adapterBlob,
bufferBlob,
lastType
};
//---------------- // StatElement //---------------- // Each analysis granule is represented by an instance of // this StatElement struct. It collects and aggregates all // information describing the allocated contents of the granule. // Free (unallocated) contents is not considered (see FreeBlk for that). // All StatElements of a heap segment are stored in the related StatArray. // Current size: 40 bytes + 8 bytes class header. class StatElement : public CHeapObj<mtCode> { public: // A note on ages: The compilation_id easily overflows unsigned short in large systems unsignedint t1_age; // oldest compilation_id of tier1 nMethods. unsignedint t2_age; // oldest compilation_id of tier2 nMethods. unsignedint tx_age; // oldest compilation_id of inactive/not entrant nMethods. unsignedshort t1_space; // in units of _segment_size to "prevent" overflow unsignedshort t2_space; // in units of _segment_size to "prevent" overflow unsignedshort tx_space; // in units of _segment_size to "prevent" overflow unsignedshort dead_space; // in units of _segment_size to "prevent" overflow unsignedshort stub_space; // in units of _segment_size to "prevent" overflow unsignedshort t1_count; unsignedshort t2_count; unsignedshort tx_count; unsignedshort dead_count; unsignedshort stub_count;
CompLevel level; // optimization level (see globalDefinitions.hpp) //---< replaced the correct enum typing with u2 to save space.
u2 compiler; // compiler which generated this blob. Type is CodeHeapState::compType
u2 type; // used only if granularity == segment_size. Type is CodeHeapState::blobType
};
//----------- // FreeBlk //----------- // Each free block in the code heap is represented by an instance // of this FreeBlk struct. It collects all information we need to // know about each free block. // All FreeBlks of a heap segment are stored in the related FreeArray. struct FreeBlk : public CHeapObj<mtCode> {
HeapBlock* start; // address of free block unsignedint len; // length of free block
unsignedint gap; // gap to next free block unsignedint index; // sequential number of free block unsignedshort n_gapBlocks; // # used blocks in gap bool stubs_in_gap; // The occupied space between this and the next free block contains (unmovable) stubs or blobs.
};
//-------------- // TopSizeBlk //-------------- // The n largest blocks in the code heap are represented in an instance // of this TopSizeBlk struct. It collects all information we need to // know about those largest blocks. // All TopSizeBlks of a heap segment are stored in the related TopSizeArray. struct TopSizeBlk : public CHeapObj<mtCode> {
HeapBlock* start; // address of block constchar* blob_name; // name of blob (mostly: name_and_sig of nmethod) unsignedint len; // length of block, in _segment_size units. Will never overflow int.
unsignedint index; // ordering index, 0 is largest block // contains array index of next smaller block // -1 indicates end of list
unsignedint nm_size; // nmeethod total size (if nmethod, 0 otherwise) int temperature; // nmethod temperature (if nmethod, 0 otherwise)
CompLevel level; // optimization level (see globalDefinitions.hpp)
u2 compiler; // compiler which generated this blob
u2 type; // blob type
};
//--------------------------- // SizeDistributionElement //--------------------------- // During CodeHeap analysis, each allocated code block is associated with a // SizeDistributionElement according to its size. Later on, the array of // SizeDistributionElements is used to print a size distribution bar graph. // All SizeDistributionElements of a heap segment are stored in the related SizeDistributionArray. struct SizeDistributionElement : public CHeapObj<mtCode> { // Range is [rangeStart..rangeEnd). unsignedint rangeStart; // start of length range, in _segment_size units. unsignedint rangeEnd; // end of length range, in _segment_size units. unsignedint lenSum; // length of block, in _segment_size units. Will never overflow int.
unsignedint count; // number of blocks assigned to this range.
};
//---------------- // CodeHeapStat //---------------- // Because we have to deal with multiple CodeHeaps, we need to // collect "global" information in a segment-specific way as well. // That's what the CodeHeapStat and CodeHeapStatArray are used for. // Before a heap segment is processed, the contents of the CodeHeapStat // element is copied to the global variables (get_HeapStatGlobals). // When processing is done, the possibly modified global variables are // copied back (set_HeapStatGlobals) to the CodeHeapStat element. struct CodeHeapStat {
StatElement* StatArray; struct FreeBlk* FreeArray; struct TopSizeBlk* TopSizeArray; struct SizeDistributionElement* SizeDistributionArray; constchar* heapName;
size_t segment_size; // StatElement data
size_t alloc_granules;
size_t granule_size; bool segment_granules; unsignedint nBlocks_t1; unsignedint nBlocks_t2; unsignedint nBlocks_alive; unsignedint nBlocks_dead; unsignedint nBlocks_unloaded; unsignedint nBlocks_stub; // FreeBlk data unsignedint alloc_freeBlocks; // UsedBlk data unsignedint alloc_topSizeBlocks; unsignedint used_topSizeBlocks; // method hotness data. Temperature range is [-reset_val..+reset_val] int avgTemp; int maxTemp; int minTemp;
};
#endif// SHARE_CODE_CODEHEAPSTATE_HPP
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.