title: java memory usage
body: <p>I know I always post a similar question about array memory usage but now I want post the question more specific.</p>
  
  <p>After I read this article: <a href="http://www.javamex.com/tutorials/memory/object_memory_usage.shtml" rel="nofollow noreferrer">http://www.javamex.com/tutorials/memory/object_memory_usage.shtml</a></p>
  
  <p>I didn't understand some things:</p>
  
  <ul>
  <li>the size of a data type is always the
  same also on different platform
  (Linux /    Windows 32 / 64 bit)???
  so an int will be always 32 bit?;</li>
  <li>when I compute the memory usage I
  must put also the reference value
  itself? If I have an object to a
  class that has an int field its
  memory will be 12 (object header) + 4
  reference + 4 (the int field) + 3
  (padding) = 24 bytes??</li>
  </ul>