public class Lock
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
Lock.GroupInfo
Descriptive information about a monitoring group.
|
private static class |
Lock.MemRecordingType
Defines basic memory recording types for executing the allocation
recording.
|
| Modifier and Type | Field and Description |
|---|---|
private static int |
nextId
Stores the next numeric id.
|
private static HashMap<java.lang.String,Lock.GroupInfo> |
REGISTERED_GROUPS
Stores the registered monitoring groups (name-shall memory be monitored).
|
private static IntHashMap<java.lang.String> |
REGISTERED_IDS
Stores the reverse mapping from
REGISTERED_GROUPS. |
(package private) static LongRecordingStackHashMap |
THREAD_STACKS
Stores the memory resource monitoring flag for the individual threads
in terms of stacks.
|
| Modifier | Constructor and Description |
|---|---|
private |
Lock()
Prevents this class from being instantiated from outside.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) static java.lang.String |
getRecorderId(int id)
Returns the recorder id for the given (internal) numeric id.
|
static long |
isStackTopMemoryAccounting(long threadId)
Returns whether the top element on the stack enables memory accounting.
|
(package private) static void |
popFromStack(long threadId,
java.lang.String recId)
Pops the latest element from the stack.
|
(package private) static void |
pushToStack(long threadId,
java.lang.String recId)
Pushes a recording group via its
recId to the execution
stack of threadId. |
static void |
registerGroup(java.lang.String className,
java.lang.String recId,
MonitoringGroupConfiguration conf)
Registers a monitoring group.
|
static void |
setStackTopMemoryAccounting(long threadId,
long account)
Changes whether memory shall be accounted for the top element of the
execution stack of a thread.
|
static final LongRecordingStackHashMap THREAD_STACKS
private static final HashMap<java.lang.String,Lock.GroupInfo> REGISTERED_GROUPS
private static final IntHashMap<java.lang.String> REGISTERED_IDS
REGISTERED_GROUPS.private static int nextId
private Lock()
public static final void registerGroup(java.lang.String className,
java.lang.String recId,
MonitoringGroupConfiguration conf)
className - the name of the class being monitored.recId - the recording identificationconf - the monitoring configurationpublic static final long isStackTopMemoryAccounting(long threadId)
setStackTopMemoryAccounting(long, long).threadId - the thread identificationpublic static final void setStackTopMemoryAccounting(long threadId,
long account)
threadId - the thread identificationaccount - the current value, negative if disabledstatic final void pushToStack(long threadId,
java.lang.String recId)
recId to the execution
stack of threadId.threadId - the thread identificationrecId - the recording identification according to which the
monitoring configuration can be determinedstatic final void popFromStack(long threadId,
java.lang.String recId)
threadId - the thread identificationrecId - the recording identification which shall be on the top
of the stack (currently just checked whether the recording
identification is not null)static final java.lang.String getRecorderId(int id)
id - the numeric id