Tag Archives: java-garbage-collection

Java virtual machine or JVM can be visualized as a virtual machine residing in the computer that provides an environment for the code to get… Read More
prerequisites: Garbage Collection, Mark and Sweep algorithm Garbage Collection: Garbage collection aka GC is one of the most important features of Java. Garbage collection is… Read More
The garbage collector in Java is automatic, i.e the user doesn’t have to manually free an occupied memory which was dynamically allocated. And how does… Read More
In C, programmers totally control allocation and deallocation of dynamically created objects. And if a programmer does not destroy objects, memory leak happens in C,… Read More
In Java, all objects are stored in the heap. They are allocated using new operator. The OutOfMemoryError Exception in Java looks like this: Exception in… Read More
Although Java provides automatic garbage collection, sometimes you will want to know how large the object heap is and how much of it is left.… Read More
An object is eligible to be garbage collected if its reference variable is lost from the program during execution.Sometimes they are also called unreachable objects.… Read More
Prerequisite – Garbage Collection in Java Difficulty level : Intermediate In Java, object destruction is taken care by the Garbage Collector module and the objects… Read More
Introduction In C/C++, programmer is responsible for both creation and destruction of objects. Usually programmer neglects destruction of useless objects. Due to this negligence, at… Read More