System gc Java

System gc: One of the salient features of Java is implicit garbage collection. Removing unwanted objects in running program is known as garbage collection. Due to the garbage collection, RAM memory is freed and the same freed memory can be used by OS for other purposes.

Due to implicit garbage collection, Java does not support the functions of C/C++ like free(), delete(), malloc(), calloc(), sizeof() etc. Java does not support destructors (supports constructors). A Java programmer is only required to mind his program and logic of coding but need not bother about memory management. See the bothersome nature of C/C++ where a programmer is required to bother coding and memory management. This is one of the reasons to say Java is simple to practice. Thanks a lot to the Java designers; they have gifted Java to the world (with many unique features); it is my personal feeling coming from the heart.

Following links of this same Web site give the complete understanding of garbage collection (System gc) of Java. If you are required how many types of algorithms exist with Java for garbage collection etc., fill the comment box at the end this notes and post.

1. Garbage Collection – gc() and exit(0)
2. Java Destructor – finalize()

==================For Extra Reading========================

1. Creating object without new Keyword
2. instanceof Keyword
3. Cloning – Duplicating an Object – Marker Interface
4. JAR (Java ARchive) Files
5. java.lang in a nutshell

Leave a Comment

Your email address will not be published.