Powered by Blogger.

Java Automatic Memory Management | Java Coding

Automatic Memory Management:

Many programming languages like C and C++ permit the memory to be allocated dynamically at runtime. After the allocated memory is no longer required, the program or runtime environment should de-allocated the memory. If the program does not de-allocate the memory that can crash eventually when there is no memory left for the system to allocate. These types of programs are said memory leaks. Java overcome this problem by using garbage collection. It provides a system level thread that tracks each memory allocation. During idle cycles in the JVM, the garbage collection thread checks for and frees any memory the can be freed in the object lifecycle.

0 comments:

Post a Comment