You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 13, 2019. It is now read-only.
class A {
int a;
}
class B extends A {
long b;
}
class C extends B {
char c;
}
public class Main
{
public static void main(String[] args)
{
C c=new C();
System.out.println(ObjectSizeCalculator.getObjectSize(c));
}
}
In 32 bits JDK,the result of your program execution is 24,but the exact result is 32.
I also write a program for calculating java object size,please take a look at java-object-size
There are some classes as follows:
In 32 bits JDK,the result of your program execution is 24,but the exact result is 32.
I also write a program for calculating java object size,please take a look at java-object-size