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

Explain the scope of a variable.

1108


What is string builder in java?

1030


List the interfaces which extends collection interface?

964


How does thread synchronization occurs inside a monitor?

1128


What is the set interface in java programming?

1230


How do you escape a string?

1004


Can java run on google chrome?

1212


can I implement my own start() method? : Java thread

1000


Is main a keyword in java?

991


Is a method a procedure?

1065


What is an example of declaration?

1014


Is vector ordered in java?

1008


Why is multiple inheritance not supported in java?

1048


What are the restriction imposed on a static method or a static block of code?

1069


what is synchronization? : Java thread

1034