By using AWS re:Post, you agree to the Terms of Use

OpenJDK JRE vs HotSpot JVM? ObjectSizeCalculator only works with HotSpot


There is a class in the java ext classes that computes object sizes but it only works with the HotSpot JVM.

What is the status of HotSpot? It took me a while to figure out that the error mesage was due to the JVM version:
java.lang.NoClassDefFoundError: Could not initialize class$CurrentLayout

This would be very useful with spark RDDs during debug...

asked 4 years ago20 views
1 Answer

I'm still curious about HotSpot but a different way to solve this is something like this using openjdk jol project:

import org.openjdk.jol

val l = List(1,2,3)

// Convert Any into AnyRef:
val jo = l.asInstanceOf[AnyRef]
val gl =
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions