15 | 11 | 2010
Main Menu
Affiliates
Who's Online
We have 21 guests online
Alexa
How to find the Real Size of an Object in java
Java Concepts
Written by javaking   
Wednesday, 07 May 2008 18:52
Article Index
How to find the Real Size of an Object in java
The Traditional Approach
New Approach
All Pages

Rating 3.1/5 (15 votes)

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.



Comments
Search
beyonddc  - Software Engineer   |199.46.198.xxx |2008-06-04 09:11:07
Aaah, that's news to me. Thanks for the info.
swadipta  - mr   |203.129.207.xxx |2009-08-25 07:22:01
Good one.. Simple to understand but let me know onething How and where we are
going to use such premain method as the process is long one. and also i have a
doubt .... How to call the premain method when you are under devloping on
eclipse.
Only registered users can write comments!

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Wednesday, 07 May 2008 18:56 )