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   SiteMap shows list of All Categories in this site.
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
Why we can not force Garbage Collection?
 Question Submitted By :: Amitkumar
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Why we can not force Garbage Collection?
Answer
# 1
who says can not run garbage collector forcefuly?
we can as System.gc();
 
Is This Answer Correct ?    1 Yes 5 No
Neeraj_passion2001
[SOWSIA INDIA PVT LTD]
 
  Re: Why we can not force Garbage Collection?
Answer
# 2
we can request it by calling System.gc() or Runtime.gc() but
there is no guarante that gc will run immidiately.....
 
Is This Answer Correct ?    8 Yes 0 No
Ramesh9396962999
 
 
 
  Re: Why we can not force Garbage Collection?
Answer
# 3
Hi Ramesh
   Sir Garbage collector is a thread and nothing can 
pridict about the excecution time of a thread at runtime.
System.gc(); is a method to start that non user thread 
explicitly.
 
Is This Answer Correct ?    1 Yes 0 No
Neeraj
 
  Re: Why we can not force Garbage Collection?
Answer
# 4
Hi All....
yea thats true that we can't force for Garbage Collection. 
We can send a request by system.gc(); at any time but its 
not sure that garbage collection takes place at that time. 
It depends on memory. So we cant forcr fot GC either 
sending the explicit request.

can catch me on +91-9899954354
 
Is This Answer Correct ?    6 Yes 0 No
Pradeep Panwar
 
  Re: Why we can not force Garbage Collection?
Answer
# 5
when jvm find that the object of that class is not used for
long time ,if that situation occurs then jmv jmv
automatically calls that garbage collector
 
Is This Answer Correct ?    2 Yes 0 No
Rohit
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is the immediate parent class of the Applet class?  1
what is the use of servlet engine? Photon2
How the elements are organized in BorderLayout?  4
Difference between this(), super()?  8
How to avoid the runtime exception ?  2
What is an enumeration class?  2
If two threads call a static method at the same point of time, what will happen? KPIT1
What is deadlock and how to avoid this?  2
What is parameter tag and what is its use?  1
Under what circumstances an object reference be cast to an interface reference?  3
What is emant by API? is it related to java only or it is common for all OOPS supporting language?  2
What do you mean by the term transient? Ericsson4
why String class is immutable. iGate3
whst is encapsulation?when u encpsulate actually while devoloping code? AMDOC5
Which containers use a FlowLayout as their default layout?  3
Which class is extended by all other classes?  2
where lives in jvm  3
What is the use of Getters and Setters method ?  2
what is diff bet iterator and enumeration?  2
how to handle http request in struts Polaris2
 
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