Join the Codozzle community now and ask questions, share knowledge, and connect with peers and industry leaders!
Log in to keep sharpening those coding skills.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What do you mean by Garbage collection in programming?
whenever we create an object using new keyword in java program, JVM will create new object in your heap memory in JRE. Also a reference will be given with the address of object in heap memory, reference will be stored in stack memory. After the execution of your main method reference given for thatRead more
whenever we create an object using new keyword in java program, JVM will create new object in your heap memory in JRE. Also a reference will be given with the address of object in heap memory, reference will be stored in stack memory. After the execution of your main method reference given for that object will get deleted/removed from stack memory. Now your object has no reference, such objects are called as Garbage Objects. These objects will be collected by Garbage Collector. this whole process is known as Garbage Collection in programming, which makes our memory not to be filled with unwanted objects. This process will be done for every 2 milliSeconds.
See less