• Post Reply Bookmark Topic Watch Topic
  • New Topic

Objects storage  RSS feed

 
Vaibhav Goel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends my question is:

Where do objects stored in Java and what is their storage size?
 
Ganesh Kumar
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi goel

Objects,Instance variables are stored in Heap and the local variables are stored in the Stack
 
bala kris
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

The object will store in the memory called heap and have an object reference in the stack memory
 
Vaibhav Goel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bala kris:
hi,

The object will store in the memory called heap and have an object reference in the stack memory


thanks for replying for my first question, but i had also asked about how to calculate/estimate the storage size of objects?

Awaiting for your reply.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The short answer is "you can't and you probably don't need to". The longer answers have been discussed many times in JavaRanch. Please search the various forums, or use Google to search them all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!