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?

Answers were Sorted based on User's Feedback



Why we can not force Garbage Collection?..

Answer / ramesh9396962999

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 ?    19 Yes 1 No

Why we can not force Garbage Collection?..

Answer / pradeep panwar

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 ?    13 Yes 1 No

Why we can not force Garbage Collection?..

Answer / neeraj

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 ?    5 Yes 1 No

Why we can not force Garbage Collection?..

Answer / 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

Why we can not force Garbage Collection?..

Answer / rohit

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 ?    4 Yes 2 No

Why we can not force Garbage Collection?..

Answer / vineet verma[birlasoft]

garbage collection is a independent thread in memory.JVM
set the priorty of this thread.system.gc() just request the
JVM to run garbage collection.its up to JVM wether to set
priorty and when..

Is This Answer Correct ?    2 Yes 0 No

Why we can not force Garbage Collection?..

Answer / neeraj_passion2001

who says can not run garbage collector forcefuly?
we can as System.gc();

Is This Answer Correct ?    4 Yes 15 No

Post New Answer

More Core Java Interview Questions

what is the use of abstract class and interface with example?

2 Answers   Cycore, DNS, Technoram,


When we should use serialization?

0 Answers  


Difference between a Scrollbar and a ScrollPane?

1 Answers  


What is complexity in java?

0 Answers  


Explain about the performance aspects of core java?

0 Answers  


Is java pass by value or pass by reference?

0 Answers  


What is memory leak and how does java handle it?

0 Answers  


Explain about transient variables in java?

0 Answers  


Why we cannot override static method?

0 Answers  


Difference between == and .equals() ?

0 Answers  


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.

0 Answers   Manhattan,


How do you get length in java?

0 Answers  


Categories