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 is the difference between object oriented programming language and object based programming language?

1025


What is the scope or life time of instance variables?

1120


What is difference between final and immutable?

1152


What is the difference between sop and work instruction?

927


What is the hashcode () and equals () used for?

1039


What is the order of arraylist in java?

1143


What is the difference between keyword and identifier?

1030


What is a class in java?

1016


What are the problems faced by java programmers who don't use layout managers?

985


What is javac in java?

1015


What is the difference between a factory and abstract factory pattern?

1148


What is better - 'bit-shift a value' or 'multiply by 2'?

1195


What does the ‘static’ keyword mean? Is it possible to override private or static method in java?

992


What is java reflection api?

1024


What is stack explain?

1008