Java code comprise of class and variable. Class and Variable come with different scope(private/public/static). All this takes memory. JVM has been given responsibility to run the java code. JVM gives memory for class/variables. But how does JVM manages memory? Let's imagine JVM memory as big box as it is shown in the picture below. We will... Continue Reading →
int vs Integer – Java Application Memory Usage
Before you read further, Please answer the following question: A. int a = 100; B. Integer b = new Integer(100); There are two java statements written above. What is the ratio of memory used by b to memory used by a in a 32 bit machine? The four options are: 1 1.5 2 4... Continue Reading →