This week's book giveaway is in the Python forum.
We're giving away four copies of Hello World and have Warren & Carter Sande on-line!
See this thread for details.
Win a copy of Hello World this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Memory allocation of Objects in JAVA

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Is there any mechanism through which we can find the occupied memory area by an Object?
Is it true that if we instantiate a subclass then the occupied memory by the object will be greater than the superclass' object ?

class A{}
class B extends A{}

Let instance of A occupy 3KB.
How can be it found the occupied memory area by an instance of B?
 
Marshal
Posts: 6542
1192
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not related to SCJP. Moving...
 
Sheriff
Posts: 21859
105
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sizeof for Java.
 
Police line, do not cross. Well, this tiny ad can go through:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!