The Problem Link to heading
Here’s an example of valuable information being available in the documentation - but not easily so (as in not easy to find)… For instance, a Google search for [C didn’t throw up anything of relevance.
Backdrop to the search for this information was a JVM Heap memory allocation issue that prompted me to do a Histogram of the Heap using JMAP. It showed that 2.2GB of type [C were allocated. My guess was array of chars and it turns out that I was right…
The Solution Link to heading
http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getName()
If this class object represents a class of arrays, then the internal form of the name consists of the name of the element type preceded by one or more [ characters representing the depth of the array nesting. The encoding of element type names is as follows:
| Element Type | Encoding |
|---|---|
| boolean | Z |
| byte | B |
| char | C |
| class or interface | L classname ; |
| double | D |
| float | F |
| int | I |
| long | J |
| short | S |
Originally published at https://jensenmo.blogspot.com/2013/10/recognising-object-types-in-jvm-memory.html