File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

size of object

 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose I have a java class(TabsAsset) with 20 fields. Then what could be the size of object when I initialize the object.
TabsAsset ta = new TabsAsset();
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Formally, it's implementation-dependent, and invisible from Java. Practically, assume 32 bits for each member, plus a 32-bit pointer to the class record, and that will certainly be in the right ballpark.
 
Hung Yee
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaWorld has an article on this topic that might interest you:
http://www.javaworld.com/javaworld/javaqa/2003-12/02-qa-1226-sizeof.html
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic