Java Collection Overhead

The Java Virtual Machine enables Java applications to be platform-independent while optimizing performance. One crucial component to understand, when considering performance, especially memory utilization, is how the Java Collections Framework, specifically the ArrayList, handles size and capacity. In this article,…

In which region intern strings are stored?

The intern() function in Java's String class helps reduce memory consumption by eliminating duplicate string objects, storing intern strings in the JVM heap memory. Earlier, intern strings were in the Perm Generation, but since Java 7, they reside in the Heap region. A practical experiment confirmed this memory behavior.