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  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 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
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther 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 ?    4 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 ?    1 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 ?    2 Yes 0 No
Uv
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
how many types of cloning? Mobily1
Have you used any version control ? if so explain about it?  1
how many ways to create Thread and which one is good? runnable interface ot Thread class? Satyam3
How to perform Singleton of the java class object on multi JVM?  1
Explain class A{} class B{} class C{} all the three classes are saved in a single file name, what the name should i provide to the file ,in what file name should i run the program? Ple Explain DNS6
How many bits are allocated to represent character of character sets - Unicode, ASCII, UTF-16, UTF-8?  1
Which of these methods belong to Thread & Object class? join, yield, sleep, wait, notify Ericsson2
write a progam hashmap & hashtable? IBM2
Does any tag exists in HTML to upload and download files ?  2
What is lazy activation? CMC1
What happens when you assigned a 'double' value to a 'String'?  6
Where the CardLayout is used?  1
what are the new features available in java 1.5 version? Motorola2
What is synchronization? How it can be achieved?  2
what is the difference b/w design pattern and architecture Covansys2
What is the return type of readLine() when end of a file is reached?  1
what is difference between requestprocessor and request dispatcher? Tech-Mahindra1
Can we inherit the constructor in a Class?please give one example. iGate3
where lives in jvm  3
What modifiers are used with a top level class?  2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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