How to send a request to garbage collector?

Answer Posted / nilesh bhil

Garbage collector is automatically called by JVM.
But can make the request by calling gc() method on System class as follows.
System.gc();
Note that we are making only request Garbage Collector may
called or may not called.
Garbage Collector is automatically called at two conditions.
1)When CPU is ideal.
2)When huge amount of memory is required.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?

1952


What is mdb and what is the special feature of that?

758


Explain the difference between object state and behavior?

740


Name three component subclasses that support painting?

802


Explain what is synchronization?

813






What state does a thread enter when it terminates its processing?

800


whats is statement and procedure

1789


What is difference between object state and behavior?

792


Difference between loadclass and class.forname?

784


What is jboss?

758


What is the purpose of the notify() method?

798


What are the different types of exception?

770


What is the difference between RMI registry and OS Agent?

853


What method is invoked to cause an object to begin executing as a separate thread?

753


How are commas used in the intialization and iteration parts of a for statement?

792