| java.lang.Object org.netbeans.lib.profiler.server.system.Stacks
Stacks | public class Stacks (Code) | | Provides methods for accessing thread stacks contents.
author: Misha Dmitriev |
Method Summary | |
native public static void | clearNativeStackFrameBuffer() Clear the above stack frame buffer permanently. | native public static void | createNativeStackFrameBuffer(int sizeInFrames) Creates the internal, C-level stack frame buffer, used for intermediate storage of data obtained using
getCurrentStackFrameIds. | native public static int | getCurrentJavaStackDepth(Thread thread) | native public static int | getCurrentStackFrameIds(Thread thread, int stackDepth, int[] stackFrameIds) stackDepth parameter is the maximum number of stack frames that can be sampled. | native public static byte[] | getMethodNamesForJMethodIds(int nMethods, int[] methodIds, int[] packedArrayOffsets) For the given array of jmethodIds, returns the names of the respective methods as
(class name, method name and method signature) triplets. | public static void | initialize() |
clearNativeStackFrameBuffer | native public static void clearNativeStackFrameBuffer()(Code) | | Clear the above stack frame buffer permanently.
|
createNativeStackFrameBuffer | native public static void createNativeStackFrameBuffer(int sizeInFrames)(Code) | | Creates the internal, C-level stack frame buffer, used for intermediate storage of data obtained using
getCurrentStackFrameIds. Since just a single buffer is used, getCurrentStackFrameIds is obviously not
multithread-safe. The code that uses this stuff has to use a single lock - so far not a problem for memory
profiling where we use it, since normally it collects data for just every 10th object, thus the probability
of contention is not very high.
|
getCurrentJavaStackDepth | native public static int getCurrentJavaStackDepth(Thread thread)(Code) | | Returns the number of Java frames on the stack of the current thread
|
getCurrentStackFrameIds | native public static int getCurrentStackFrameIds(Thread thread, int stackDepth, int[] stackFrameIds)(Code) | | stackDepth parameter is the maximum number of stack frames that can be sampled. Returns the actual number of
stack frames sampled.
|
getMethodNamesForJMethodIds | native public static byte[] getMethodNamesForJMethodIds(int nMethods, int[] methodIds, int[] packedArrayOffsets)(Code) | | For the given array of jmethodIds, returns the names of the respective methods as
(class name, method name and method signature) triplets.
All this symbolic information is returned as a single packed array of bytes (with each string in UTF8 format).
packedArrayOffsets is filled out with offsets of all of these strings.
Parameters: nMethods - The number of methods, length of the methodIds array Parameters: methodIds - An array of jMethodIds for which we need their names Parameters: packedArrayOffsets - An array that, upon return from this method, will contain the indexes into the returnedarray A packed array of bytes of triplets [class name, method name, method signature], packedArrayOffsetscontains indexes into this array for individual items |
initialize | public static void initialize()(Code) | | Should be called at earliest possible time
|
|
|