Thursday, October 22, 2009

5 Things you should know about String Constant Pool.

  • When a Class was compiled the String literals are noted in a special way by the compiler.
  • Once the Class get loaded, all the String literals which are inside the class are placed inside the String Constant Pool. So once the Class got initialized all the String literals are ready for use.
  • String Constant Pool is Constant Table which will hold all the String Literal Objects which lives on the heap.
  • Most of people think String Constant Pool is where the String Literal Object are Stored, but that's not true."All the Objects are Stored one and only in HEAP"
  • During Garbage Collections, the values which are String Literals are not Garbage Collected. The reason is GC only collects the objects which are not referred. But String Literals objects (in Heap) are referred by the String Constant Pool (Constant Table).

1 comment:

Anonymous said...

are you sure buddy? i guess not.

Post a Comment

 

This content comes from a hidden element on this page.

The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.
Click me, it will be preserved!

If you try to open a new ColorBox while it is already open, it will update itself with the new content.

Updating Content Example:
Click here to load new content