How do you determine the size of an object in Java? - Just Crack Interview

How do you determine the size of an object in Java?

How do you determine the size of an object in Java?

Ques:- How do you determine the size of an object in Java?
1 5183

One Answer on this Question

  1. One way to get an estimate of an object’s size in Java is to use getObjectSize(Object) method of the Instrumentation interface introduced in Java 5. As we could see in Javadoc documentation, the method provides “implementation-specific approximation” of the specified object’s size.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top