src/share/vm/memory/allocation.hpp

Print this page
rev 4773 : 8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>


 140  */
 141 enum MemoryType {
 142   // Memory type by sub systems. It occupies lower byte.
 143   mtNone              = 0x0000,  // undefined
 144   mtClass             = 0x0100,  // memory class for Java classes
 145   mtThread            = 0x0200,  // memory for thread objects
 146   mtThreadStack       = 0x0300,
 147   mtCode              = 0x0400,  // memory for generated code
 148   mtGC                = 0x0500,  // memory for GC
 149   mtCompiler          = 0x0600,  // memory for compiler
 150   mtInternal          = 0x0700,  // memory used by VM, but does not belong to
 151                                  // any of above categories, and not used for
 152                                  // native memory tracking
 153   mtOther             = 0x0800,  // memory not used by VM
 154   mtSymbol            = 0x0900,  // symbol
 155   mtNMT               = 0x0A00,  // memory used by native memory tracking
 156   mtChunk             = 0x0B00,  // chunk that holds content of arenas
 157   mtJavaHeap          = 0x0C00,  // Java heap
 158   mtClassShared       = 0x0D00,  // class data sharing
 159   mtTest              = 0x0E00,  // Test type for verifying NMT
 160   mt_number_of_types  = 0x000E,  // number of memory types (mtDontTrack

 161                                  // is not included as validate type)
 162   mtDontTrack         = 0x0F00,  // memory we do not or cannot track
 163   mt_masks            = 0x7F00,
 164 
 165   // object type mask
 166   otArena             = 0x0010, // an arena object
 167   otNMTRecorder       = 0x0020, // memory recorder object
 168   ot_masks            = 0x00F0
 169 };
 170 
 171 #define IS_MEMORY_TYPE(flags, type) ((flags & mt_masks) == type)
 172 #define HAS_VALID_MEMORY_TYPE(flags)((flags & mt_masks) != mtNone)
 173 #define FLAGS_TO_MEMORY_TYPE(flags) (flags & mt_masks)
 174 
 175 #define IS_ARENA_OBJ(flags)         ((flags & ot_masks) == otArena)
 176 #define IS_NMT_RECORDER(flags)      ((flags & ot_masks) == otNMTRecorder)
 177 #define NMT_CAN_TRACK(flags)        (!IS_NMT_RECORDER(flags) && !(IS_MEMORY_TYPE(flags, mtDontTrack)))
 178 
 179 typedef unsigned short MEMFLAGS;
 180 




 140  */
 141 enum MemoryType {
 142   // Memory type by sub systems. It occupies lower byte.
 143   mtNone              = 0x0000,  // undefined
 144   mtClass             = 0x0100,  // memory class for Java classes
 145   mtThread            = 0x0200,  // memory for thread objects
 146   mtThreadStack       = 0x0300,
 147   mtCode              = 0x0400,  // memory for generated code
 148   mtGC                = 0x0500,  // memory for GC
 149   mtCompiler          = 0x0600,  // memory for compiler
 150   mtInternal          = 0x0700,  // memory used by VM, but does not belong to
 151                                  // any of above categories, and not used for
 152                                  // native memory tracking
 153   mtOther             = 0x0800,  // memory not used by VM
 154   mtSymbol            = 0x0900,  // symbol
 155   mtNMT               = 0x0A00,  // memory used by native memory tracking
 156   mtChunk             = 0x0B00,  // chunk that holds content of arenas
 157   mtJavaHeap          = 0x0C00,  // Java heap
 158   mtClassShared       = 0x0D00,  // class data sharing
 159   mtTest              = 0x0E00,  // Test type for verifying NMT
 160   mtTracing           = 0x0F00,  // memory used for Tracing
 161   mt_number_of_types  = 0x000F,  // number of memory types (mtDontTrack
 162                                  // is not included as validate type)
 163   mtDontTrack         = 0x0F00,  // memory we do not or cannot track
 164   mt_masks            = 0x7F00,
 165 
 166   // object type mask
 167   otArena             = 0x0010, // an arena object
 168   otNMTRecorder       = 0x0020, // memory recorder object
 169   ot_masks            = 0x00F0
 170 };
 171 
 172 #define IS_MEMORY_TYPE(flags, type) ((flags & mt_masks) == type)
 173 #define HAS_VALID_MEMORY_TYPE(flags)((flags & mt_masks) != mtNone)
 174 #define FLAGS_TO_MEMORY_TYPE(flags) (flags & mt_masks)
 175 
 176 #define IS_ARENA_OBJ(flags)         ((flags & ot_masks) == otArena)
 177 #define IS_NMT_RECORDER(flags)      ((flags & ot_masks) == otNMTRecorder)
 178 #define NMT_CAN_TRACK(flags)        (!IS_NMT_RECORDER(flags) && !(IS_MEMORY_TYPE(flags, mtDontTrack)))
 179 
 180 typedef unsigned short MEMFLAGS;
 181