Posts

Garbage Collection in JAVA

Java has a very good memory management system. When an object in Java is no longer useful, or we can say that we will not require that object in the future, it is destroyed. The memory space is now available for any other purpose that was previously occupied. The Garbage Collector in Java handles the entire process. Garbage collection (or GC) is a method of reclaiming memory that is no longer in use for reuse. Unlike other languages that require manual allocation and destruction of objects, Java programmers do not need to pick up and study each object to determine whether it is required. The garbage collector is the perfect example of a Daemon thread because it runs in the background all the time. DAEMON THREAD A daemon thread is a low-priority thread that performs operations such as garbage collection in the background. Properties: The daemon status of a newly generated thread is inherited by it. Because the main thread is non-daemon, all threads formed within it (children of the main
Recent posts