Tutorial: Java General Java Eligibility for garbage collection Tutorial
An object is eligible for garbage collection when no live thread can access it. An object can become eligible for garbage collection in different ways.
Tutorial Details:
Java Eligibility for garbage collection
An object is eligible for garbage collection when no live thread can access it.
An object can become eligible for garbage collection in different ways:
If the reference variable that refers to the object is set to null, the object becomes eligible for garbage collection, provided that no other reference is referring to it.
If the reference variable that refers to the object is made to refer to some other object, the object becomes eligible for garbage collection, provided that
no other reference is referring to it.
Objects created locally in a method are eligible for garbage collection when the method returns, unless they are exported out of the method (that is, returned or thrown as an exception).
Objects that refer to each other can still be eligible for garbage collection if no live thread can access either of them.
The Integer object initially referred to by the reference o1 becomes eligible for garbage collection after line 3. This is because o1 now refers to the String object. Even though o2 is now made to refer to null, the String object is not eligible for garbage collection because o1 refers to it.
Garbage Collection in the Java HotSpot Virtual Machine
Garbage Collection in the Java HotSpot Virtual Machine
Gain a better understanding of how garbage collection in the Java HotSpot VM works, and learn to take full advantage of it when designing, developing, and deploying your Java applications.
Servlet Essentials
This document explains the concepts of Java Servlets and provides a step-by-step tutorial for writing HTTP Servlets with complete source code for the example Servlets. The tutorial and the other chapters cover all facets of Servlet programming from a ...
Core Java Interview Questions!
Core Java Interview Questions!
Core Java Interview Questions
Question: What is transient variable?
Answer: Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written
Collection of Large Number of Java Interview Questions!
Collection of Large Number of Java Interview Questions!
Collection of Large Number of Java Interview Questions
The Core Java Interview Questions
The Jakarta Struts Interview Questions
Collection of Large Number of Java Sample Programs and Tutorials
Collection of Large Number of Java Sample Programs and Tutorials
Collection of Large Number of Java Sample Programs and Tutorials
HelloWorld Java Program
Simple Java Program for beginners that prints HelloWorld! on console.
Introduction to the JSP Java Server Pages
Introduction to the JSP Java Server Pages
Welcome to JSP Section
Introduction To JSP
Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP provide excellent server side scripting support for creating database