JOL 0.4

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Dec 2 20:53:56 UTC 2015


Hi,

JOL 0.4 is released and available at Maven Central (thanks to Evgeny
Mandrikov, as always!). This is a feature release, and includes the
following changes:

 * GraphLayout.parseInstance varargs method may mismatch the arrays for
the varargs arguments. To avoid that, we introduced a new GraphLayout
method that accepts the non-vararg arguments. If you recompile the code
that depends on JOL, a correct method should be selected automatically.
Tracking:
  https://bugs.openjdk.java.net/browse/CODETOOLS-7901533

 * JOL 0.3.2 shown the "synthetic" <length> field for arrays. It does
make sense to poll the actual value from the array instances, and we are
doing it now, treating the array length as the part of object header (as
Hotspot does). Tracking:
  https://bugs.openjdk.java.net/browse/CODETOOLS-7901531

 * Sometimes, object header data (e.g. array length) is digestible in
decimal notation. This prompted us to add the decimal output, together
with the existing hex and binary ones. Tracking:
  https://bugs.openjdk.java.net/browse/CODETOOLS-7901532

 * The Java API for ClassLayout.parseClass is very unfortunate for
variable-sized instances (e.g. arrays). To solve that, we introduced
ClassLayout.parseInstance family of methods. This also makes user code
simpler. Tracking:
  https://bugs.openjdk.java.net/browse/CODETOOLS-7901530

 * GraphLayouts got new methods for adding and subtracting another
GraphLayout, which is handy for differential analysis. Tracking:
  https://bugs.openjdk.java.net/browse/CODETOOLS-7901529

Reminder: most JOL tools are available in a pre-compiled fat JAR in a
jol-cli project. You may self-build it, or pull it from Maven Central.
It works e.g. like  this:
 $ java -jar jol-cli.jar internals -cp myjar.jar:myjar2.jar test.MyClass
 $ java -jar jol-cli.jar internals -cp target/classes test.MyClass

Enjoy!

Thanks,
-Aleksey.



More information about the jol-dev mailing list