|
Java Concepts
|
|
Written by javaking
|
|
Wednesday, 07 May 2008 18:52 |
|
Page 1 of 3 In this Article we present you why it is difficult in java to measure the size of an object, we also narrate the traditional method used by programmers to measure the size of objects in java and then we present to you the latest and most accurate way to measure the size of an object.
When java was developed first there was no real way to measure the size of an object. Java does not provide any sizeOf() operator like C. This is because in C programmers have to manually allocate memory using malloc().In java, memory allocation and object construction are both tied together, This makes it more difficult to find the size of an object. Developers used an indirect way to measure the amount of memory occupied by an object. This method was always prone to errors due to various reasons.
|
|
Last Updated ( Wednesday, 07 May 2008 18:56 )
|