| Modifier and Type | Class and Description |
|---|---|
| private static class | ThreadDumper.
A ByteArrayOutputStream of bounded size. |
| private static class | ThreadDumper.
JSON is schema-less and the thread dump format will evolve over time. |
| private static class | ThreadDumper.
Simple JSON writer to stream objects/arrays to a TextWriter with formatting. |
| private static class | ThreadDumper.
Simple Writer implementation for printing text. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | decorateObject(Object obj)
Returns the identity string for the given object in a form suitable for the plain text format thread dump. |
| private static boolean | |
| private static boolean | Returns: true if the thread dump was written, false otherwiseWrite a thread to the given JSON writer. |
| public static byte[] | Returns: the UTF-8 encoded thread dump or message to return to the tool userthe file path to the file, null or "-" to return a byte array file, boolean true to overwrite an existing file okayToOverwrite)Generate a thread dump in plain text format to a file or byte array, UTF-8 encoded. |
| public static void | dumpThreads(OutputStream out)
Generate a thread dump in plain text format to the given output stream, UTF-8 encoded. |
| private static void | dumpThreads(ThreadDumper.
Generate a thread dump in plain text format to the given text stream. |
| private static void | |
| private static void | dumpThreads(ThreadContainer container, ThreadDumper.
Write a thread container to the given JSON writer. |
| private static byte[] | dumpThreadsToByteArray(boolean json, int maxSize)
Generate a thread dump in plain text or JSON format to a byte array, UTF-8 encoded. |
| private static byte[] | dumpThreadsToFile(String file, boolean okayToOverwrite, boolean json)
Generate a thread dump in plain text or JSON format to the given file, UTF-8 encoded. |
| public static byte[] | Returns: the UTF-8 encoded thread dump or message to return to the tool userthe file path to the file, null or "-" to return a byte array file, boolean true to overwrite an existing file okayToOverwrite)Generate a thread dump in JSON format to a file or byte array, UTF-8 encoded. |
| public static void | dumpThreadsToJson(OutputStream out)
Generate a thread dump in JSON format to the given output stream, UTF-8 encoded. |
| private static void | dumpThreadsToJson(ThreadDumper.
Generate a thread dump to the given text stream in JSON format. |
| private static long |
| MAX_BYTE_ARRAY_SIZE | back to summary |
|---|---|
| private static final int MAX_BYTE_ARRAY_SIZE | |
| ThreadDumper | back to summary |
|---|---|
| private ThreadDumper() | |
| decorateObject | back to summary |
|---|---|
| private static String decorateObject(Object obj) Returns the identity string for the given object in a form suitable for the plain text format thread dump. | |
| dumpThread | back to summary |
|---|---|
| private static boolean dumpThread(Thread thread, ThreadDumper. | |
| dumpThread | back to summary |
|---|---|
| private static boolean dumpThread(Thread thread, ThreadDumper. Write a thread to the given JSON writer.
| |
| dumpThreads | back to summary |
|---|---|
| public static byte[] dumpThreads(String file, boolean okayToOverwrite) Generate a thread dump in plain text format to a file or byte array, UTF-8 encoded. This method is invoked by the VM for the Thread.dump_to_file diagnostic command.
| |
| dumpThreads | back to summary |
|---|---|
| public static void dumpThreads(OutputStream out) throws IOException Generate a thread dump in plain text format to the given output stream, UTF-8 encoded. This method is invoked by HotSpotDiagnosticMXBean.dumpThreads.
| |
| dumpThreads | back to summary |
|---|---|
| private static void dumpThreads(ThreadDumper. Generate a thread dump in plain text format to the given text stream.
| |
| dumpThreads | back to summary |
|---|---|
| private static void dumpThreads(ThreadContainer container, ThreadDumper. | |
| dumpThreads | back to summary |
|---|---|
| private static void dumpThreads(ThreadContainer container, ThreadDumper. Write a thread container to the given JSON writer.
| |
| dumpThreadsToByteArray | back to summary |
|---|---|
| private static byte[] dumpThreadsToByteArray(boolean json, int maxSize) Generate a thread dump in plain text or JSON format to a byte array, UTF-8 encoded. This method is the implementation of the Thread.dump_to_file diagnostic command when a file path is not specified. It returns the thread dump and/or message to send to the tool user. | |
| dumpThreadsToFile | back to summary |
|---|---|
| private static byte[] dumpThreadsToFile(String file, boolean okayToOverwrite, boolean json) Generate a thread dump in plain text or JSON format to the given file, UTF-8 encoded. This method is the implementation of the Thread.dump_to_file diagnostic command. It returns the thread dump and/or message to send to the tool user. | |
| dumpThreadsToJson | back to summary |
|---|---|
| public static byte[] dumpThreadsToJson(String file, boolean okayToOverwrite) Generate a thread dump in JSON format to a file or byte array, UTF-8 encoded. This method is invoked by the VM for the Thread.dump_to_file diagnostic command.
| |
| dumpThreadsToJson | back to summary |
|---|---|
| public static void dumpThreadsToJson(OutputStream out) throws IOException Generate a thread dump in JSON format to the given output stream, UTF-8 encoded. This method is invoked by HotSpotDiagnosticMXBean.dumpThreads.
| |
| dumpThreadsToJson | back to summary |
|---|---|
| private static void dumpThreadsToJson(ThreadDumper. Generate a thread dump to the given text stream in JSON format.
| |
| processId | back to summary |
|---|---|
| private static long processId() Returns the process ID or -1 if not supported. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closing a |
| public void | write(int b)
Overrides java. Writes the specified byte to this |
| public void | write(byte[] b, int off, int len)
Overrides java. Writes |
| max | back to summary |
|---|---|
| pack-priv final int max | |
| BoundedByteArrayOutputStream | back to summary |
|---|---|
| pack-priv BoundedByteArrayOutputStream(int max) | |
| close | back to summary |
|---|---|
| public void close() Overrides java. Implements java. Doc from java. Closing a
| |
| write | back to summary |
|---|---|
| public void write(int b) Overrides java. Doc from java. Writes the specified byte to this
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) Overrides java. Doc from java. Writes
| |
HotSpotDiagnosticMXBean.dumpThreads links to a JSON file that documents
the latest/current format. A system property can be used to generate the thread
dump in older formats if necessary.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static int |
| JSON_FORMAT | back to summary |
|---|---|
| private static final int JSON_FORMAT | |
| JSON_FORMAT_LATEST | back to summary |
|---|---|
| private static final int JSON_FORMAT_LATEST | |
| JSON_FORMAT_V1 | back to summary |
|---|---|
| pack-priv static final int JSON_FORMAT_V1 | |
| JSON_FORMAT_V2 | back to summary |
|---|---|
| pack-priv static final int JSON_FORMAT_V2 | |
| JSON_FORMAT_VERSION_PROP | back to summary |
|---|---|
| private static final String JSON_FORMAT_VERSION_PROP | |
| JsonFormat | back to summary |
|---|---|
| private JsonFormat() | |
| formatVersion | back to summary |
|---|---|
| pack-priv static int formatVersion() | |
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final Deque | |
| private final ThreadDumper. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| private void | |
| pack-priv void | |
| private static String | |
| private void | |
| pack-priv void | |
| private void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | writeProperty(String
the property name, null for an unnamed property name, Object the value or null obj)Write a property. |
| pack-priv void |
| generateLongsAsString | back to summary |
|---|---|
| private final boolean generateLongsAsString | |
| stack | back to summary |
|---|---|
| private final Deque<ThreadDumper. | |
| writer | back to summary |
|---|---|
| private final ThreadDumper. | |
| JsonWriter | back to summary |
|---|---|
| pack-priv JsonWriter(ThreadDumper. | |
| endArray | back to summary |
|---|---|
| pack-priv void endArray() End of array. | |
| endObject | back to summary |
|---|---|
| private void endObject(boolean isArray) End of object or array. | |
| endObject | back to summary |
|---|---|
| pack-priv void endObject() End of object. | |
| escape | back to summary |
|---|---|
| private static String escape(String value) Escape any characters that need to be escape in the JSON output. | |
| indent | back to summary |
|---|---|
| private void indent() | |
| startArray | back to summary |
|---|---|
| pack-priv void startArray(String name) Start named array. | |
| startObject | back to summary |
|---|---|
| private void startObject(String name, boolean isArray) Start of object or array. | |
| startObject | back to summary |
|---|---|
| pack-priv void startObject(String name) Start named object. | |
| startObject | back to summary |
|---|---|
| pack-priv void startObject() Start unnamed object. | |
| writeLongProperty | back to summary |
|---|---|
| pack-priv void writeLongProperty(String name, long value) Write a property with a long value. If the value is outside the "interop" range of IEEE-754 double-precision floating point (64-bit) then it is written as a string. | |
| writeProperty | back to summary |
|---|---|
| pack-priv void writeProperty(String name, Object obj) Write a property. | |
| writeProperty | back to summary |
|---|---|
| pack-priv void writeProperty(Object obj) Write an unnamed property. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final boolean | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | |
| pack-priv boolean | |
| pack-priv int |
| isArray | back to summary |
|---|---|
| pack-priv final boolean isArray | |
| propertyCount | back to summary |
|---|---|
| pack-priv int propertyCount | |
| Node | back to summary |
|---|---|
| pack-priv Node(boolean isArray) | |
| getAndIncrementPropertyCount | back to summary |
|---|---|
| pack-priv int getAndIncrementPropertyCount() | |
| isArray | back to summary |
|---|---|
| pack-priv boolean isArray() | |
| propertyCount | back to summary |
|---|---|
| pack-priv int propertyCount() | |
| Modifier and Type | Field and Description |
|---|---|
| private final Writer |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract java. Implements java. Closes the stream, flushing it first. |
| public void | flush()
Implements abstract java. Implements java. Flushes the stream. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public void | write(char[] cbuf, int off, int len)
Implements abstract java. Writes a portion of an array of characters. |
| delegate | back to summary |
|---|---|
| private final Writer delegate | |
| TextWriter | back to summary |
|---|---|
| pack-priv TextWriter(OutputStream out) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Doc from java. Closes the stream, flushing it first. Once the stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously closed stream has no effect.
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements abstract java. Implements java. Doc from java. Flushes the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams. If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| back to summary | |
|---|---|
| pack-priv void print(Object obj) | |
| println | back to summary |
|---|---|
| pack-priv void println() | |
| println | back to summary |
|---|---|
| pack-priv void println(String s) | |
| println | back to summary |
|---|---|
| pack-priv void println(Object obj) | |
| write | back to summary |
|---|---|
| public void write(char[] cbuf, int off, int len) throws IOException Implements abstract java. Doc from java. Writes a portion of an array of characters.
| |