Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Why we can not force Garbage Collection?

Answer Posted / mohit

Hi Friends.. System.gc()does not forcefully to gc.it request
only.it has only 10% chance to run gc.but if u use
thread.sleep(1000);it has chance 50% to run gc.but if u use
for(i=1;i<=1000;i++)
{
System.gc();
}
so it has 99% chance to run gc.because gc release the memory
only when heap is full otherwise JVM is very lasy.....

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by access specifiers in Java?

961


Can you change array size in java?

917


What is a treeset in java?

989


what is function overloading in java?

1212


What is the default value of the local variables?

959


Explain the different forms of polymorphism?

953


Can singleton class be inherited in java?

938


What happens when you add a double value to a string?

934


What are the different types of inheritance in java?

951


What are void pointers?

1220


Does printwriter create a file?

910


What is tochararray in java?

877


What is java lang object?

924


What is the purpose of javac exe?

1024


What is the default size of arraylist in java?

1010