Questions tagged [jol]

Java Object Layout is a project within the OpenJDK to determine the memory layout of instances on the HotSpot virtual machine.

Java Object Layout is a project within the OpenJDK to determine the memory layout of instances on the HotSpot virtual machine.

Webpage: http://openjdk.java.net/projects/code-tools/jol/

22 questions
2
votes
1 answer

Trying to understand the footprint of ArrayList in JOLSample_16_AL_LL

Here is a link to the code in question - http://hg.openjdk.java.net/code-tools/jol/file/07087260ce41/jol-samples/src/main/java/org/openjdk/jol/samples/JOLSample_16_AL_LL.java public static void main(String[] args) throws Exception { …
Jon
  • 237
  • 3
  • 12
2
votes
1 answer

Is jol missing the main property in the MANIFEST file?

I'm trying to use jol, from openJDK. I downloaded the jar from here: http://central.maven.org/maven2/org/openjdk/jol/jol-cli/0.4/jol-cli-0.4.jar However, when I try to run with: java -jar jol-cli-0.4.jar --help I get: no main manifest attribute,…
Roberto Attias
  • 1,883
  • 1
  • 11
  • 21
1
vote
1 answer

Run jol-core exception, the exception message is "Process finished with exit code 137 (interrupted by signal 9: SIGKILL)"

I'm struggling with this problem, can I get your help. Run Environment: Mac Book 10.15.7 java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed…
zhangPH
  • 21
  • 1
1
vote
2 answers

OpenJ9 VM Object Layout

OpendJDK has a Java Object Layout (JOL) tool which allows to estimate instance real memory size of specified object. It can show an object layout for HotSpot but will it be the same in OpenJ9?
Sergey Ponomarev
  • 2,947
  • 1
  • 33
  • 43
0
votes
1 answer

Jol to find the offset of fields in the class

I use jol to find the offset of the fields as below: import java.lang.reflect.Field; public static void main(String[] args) throws NoSuchFieldException { System.out.println(ClassLayout.parseClass(Field.class).toPrintable()); } The output: OFF …
Michael Tsai
  • 751
  • 2
  • 11
  • 21
0
votes
1 answer

Pinning an object by modifying bits in mask word of object header

I was wondering if it is possible to prevent an object from being moved around by the GC by setting one of the bits in the mark word of the object header myself (trying to trick GC). So basically I would like to know if this way it could be ensured…
Haasip Satang
  • 457
  • 3
  • 17
0
votes
2 answers

Using string vs byte[] as value, Memory usage in map

I read it in multiple places that using byte[] instead of string would save you memory. I wanted to test it out using jol. Here my test: public static void main (String[] args) throws java.lang.Exception{ …
moon
  • 1,702
  • 3
  • 19
  • 35
1
2