I have an object which contains some data. How to know the memory occupied by the object in bytes in java?
SomeClass obj = new SomeClass();
obj.initialize(Data);
Here I have sample object 'obj' of SomeClass
I have an object which contains some data. How to know the memory occupied by the object in bytes in java?
SomeClass obj = new SomeClass();
obj.initialize(Data);
Here I have sample object 'obj' of SomeClass
Not possible to get indivisible object's memory. but using Runtime Class jvm memory size you can check.