This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Determining size of object? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Determining size of object?" Watch "Determining size of object?" New topic

Determining size of object?

kavitha vasu
Ranch Hand

Joined: Feb 22, 2007
Posts: 70
How can we estimate the size of the object? i think here we dont have sizeOf operator.

EDIT by mw: Changed subject line to be descriptive (was "java classes").
[ February 22, 2007: Message edited by: marc weber ]
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
The definition of size of the object depends on the object type.

So maybe you could be more specific over what size over what kind of object you want.

Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Joe Ess

Joined: Oct 29, 2001
Posts: 8843

Java Platform Performance has some tips on how to estimate the size of an object. Object size doesn't matter much to us because Java doesn't have functionality like pointer arithmetic that is frequently used in C/C++.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Willy Thorpe

Joined: Jan 18, 2007
Posts: 2
Boarding interesting about this subject.

"The time will not change of direction when the Universe to start to contract" Stephen Hawking
It is sorta covered in the JavaRanch Style Guide.
subject: Determining size of object?
Similar Threads
size of an object
Else without if error
refrence instance and object ?
Maximum size of Java Object
Find the memory size in bytes of List<Objects> in JBOSS ?