Hi, Can anybody tell me what would be the size of a instance of a class in java that contains no instance variables and methods?.( That is I call it as empty class though it extends java.lang.Object).
I dont think getting the size of an object would be possible. All you can do is get the total,max & free memory of the JVM.
You can find those methods in java.lang.Runtime class.
OCPJP 6
Avishkar Nikale
Ranch Hand
Joined: Aug 06, 2010
Posts: 173
posted
0
Peter Taucher wrote:
Did I already mention instrumentation and using method 'getObjectSize'?
Peter,
I am aware about it now. I had never used the java.lang.instrument package.