This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Java in General and the fly likes  Object Size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark " Object Size" Watch " Object Size" New topic

Object Size

jaya sudha

Joined: Jun 18, 2004
Posts: 20
How to find the size of memory allocated for an object

Igor Ko
Ranch Hand

Joined: Jun 24, 2002
Posts: 90
It is not very simple, see library from:

Them use introspection, and build tree for all including objects, until
go to primitive type.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Intermediate forum...

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: Object Size
It's not a secret anymore!