Find the size of an object in Java

Unlike languages such as C/ C++ which has a function sizeof() to get memory size of any object, Java has no such direct method. It is, still, possible to get the size of an object in Java using its instrumentation package.


This is a companion discussion topic for the original entry at http://iq.opengenus.org/find-size-of-an-object-in-java/