Simple Memory Optimizations trick for Java

Posted on August 6, 2006. Filed under: Languages and Algorithms | Tags: |

Dr. Dobb’s | Optimized Java | June 1, 2006

I just learnt that Java 5.0 introduced a new StringBuilder class, which is a non-thread safe version of StringBuffer, i.e an internal array of characters acting as buffer for fast string allocation. (Remember that Java’s String is an immutable object allocated from a memory pool. It ’s a design tradeoff for quick reference vs. allocation), plus more about autoboxing (implicit conversion from primitive types to its wrapper object) and escape analysis to allocate objects from stack instead of from heap

Make a Comment

Make a Comment: ( None so far )

blockquote and a tags work here.

Liked it here?
Why not try sites on the blogroll...