Object memory usage
1 posts in topic
Flat View  Flat View

Posted By:   Claus_Rasmussen
Posted On:   Monday, June 18, 2001 03:34 AM

Is there is a way to see how many bytes an object instance takes up in the memory?


String[] myStringArray = {"1", "2", "3"};

To my knowledge the instance myStringArray would take up 3 x 16 bytes = 48 bytes since Java uses Unicode were each character is represented by 16 bytes.

But is there any way to retrieve this byte count through a method call? What if the object contains references to other objects? Can there memory usage be calculated as well?

Re: Object memory usage

Posted By:   AlessandroA_Garbagnati  
Posted On:   Monday, June 18, 2001 10:18 AM


Check this FAQ or this one, and this interesting thread.
About | Sitemap | Contact