In this article, we’ll learn how to improve the performance of the applications that tend to use most of the space due to extensive usage of Strings. There’s no need to store more than one instance of immutable objects in our heap, and String is a good example. Object Allocation Let’s briefly refresh the information... Continue Reading →
Optimizing the Capacity of a HashMap
Many of us know that allocating more memory than we need may negatively affect the performance of our application. Thus, creating the Lists using a constructor that takes a capacity may make a significant difference. However, this optimization step might not be so straightforward while using Maps. In this article, we’ll learn how to identify... Continue Reading →
Actions on OutOfMemoryErrors
Everyone has at least once seen a failing application due to OutOfMemoryError. This error happens because the application cannot allocate the required memory. The specific reason for this problem may differ depending on the severity and heap section affected. However, in any case, we would like to have some actions prepared for this. In this... Continue Reading →
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, we will concentrate on the overhead caused by lists that contain two or three elements.... Continue Reading →
