View RSS Feed

Recent Blogs Posts

  1. Understanding String memory usage

    by , 04-26-2012 at 07:36 PM
    Fields which are present at the String object shall be looked first of all so that for a better understanding of the above calculations:

    • a char array: Separate object which consist of the actual characters;
    • an integer offset where the string starts;
    • String Length
    • Another int, for hash code’s cached calculations.



    This shows that if no characters are present in a string, even then 4 bytes would be required for sake of the char array reference along ...
    Categories
    String