The StringBuilder Object Memory Usage - Capacity

When you instantiate a new StringBuilder object, it's capacity becomes 16 characters.

StringBuilder() sb= new StringBuilder();

And when you add some characters more then 16, it's capacity raises 16, automatically. (32, 48 etc.)

If you are using some text with low amount of characters, you can instantiate a StringBuilder object with a capacity parameter.

StringBuilder() sb= new StringBuilder(6);

So the capacity of the object will become 6, 12, 18 etc. And the memory usage of the object becomes optimum for the case.