Java memory management
by, 02-18-2012 at 04:22 PM (775 Views)
There are 2 categories of Java memory management problems which are as following:
1. In-complete deallocation
2. Pre-mature deallocation
Incomplete deallocation has been divided into 2 subclasses which are:
1. Desing bugs
2. Coding bugs
Coding bugs are considered to be dependent upon language whereas design bugs are not language dependent. They are programming mistakes. Usually programmer is involved in handling the memory management in languages, e.g. C++.
Java Runtime and Java language remove the corrupted pointer problems and also other memory leaks of code level. Explanation that how it takes place is as following:
• “Explicit” memory allocation in Java is not present. It is allocated to objects only.
• Java contains a low priority thread called Garbage Collector. It is responsible for releasing occupied memory by an object when it is not accessible. It helps to collect all the unused memory.
• From complete object tree, one can make memory released in Java. This is done by making root null. All memory & objects would be collected as well as reclaimed by the Garbage collector.