ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories >> Software >> Java-Related >> Java-J2EE >> Core-Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
Question
How to send a request to garbage collector?
 Question Submitted By :: Tathagata.in
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to send a request to garbage collector?
Answer
# 1
Yes we can send arequest to garbage collection by writing a 
simple line of code:

System.gc();

OR

Runtime.gc();

But it is simply a request not a order to JVM
because Garbage collection is JVM dependent
 
Is This Answer Correct ?    1 Yes 0 No
Anjum Rehbar Khan
 
  Re: How to send a request to garbage collector?
Answer
# 2
It's Runtime.getRuntime().gc()
 
Is This Answer Correct ?    0 Yes 0 No
Chinna
 
 
 
  Re: How to send a request to garbage collector?
Answer
# 3
As far as I know,it is not required to call the garbage 
collector.
It automatically and periodically removes the unused 
objects by an algorithm known as "Mark and Sweep".

However, if we intentionally want to call it then the above 
suggestions are perfect.
Anyone who feels that it is incorrect, please feel free to 
correct me.
 
Is This Answer Correct ?    0 Yes 0 No
Uv
 
 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is "finally" keyword?  3
In the HashMap, we know the values but we dont know the key, then how can we get the key from HashMap ????? Kanbay3
static inner classes means..?  1
How many times garbage collector will invoke an object?s finalize() method?  4
How can you debug the Java code? BirlaSoft2
Explain pass by reference and pass by value? Wipro3
What are virtual functions?  1
what is difference between perfom() & excute() ? IBM2
can you create interface instance ? Fidelity23
can anyone explain me the concept of autoboxing?  1
What is the exact difference in between Unicast and Multicast object ? Accenture1
what is difference between type 4 driver and type 1 driver? CMC1
what is mean by method signature? Satyam5
What method is used to compare two strings ?  3
When is an object in the mean to garbage collection?  3
Can you run the product development on all operating systems ?  1
What is multiple inheritance & can we implement it in java? Satyam4
what is features of jdk 1.5? TCS2
Which class has no duplicate elements?  6
how to handle exceptions in core applications? CSS2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com