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
What is the difference between object oriented programming language and object based programming language?
What is the scope or life time of instance variables?
What is difference between final and immutable?
What is the difference between sop and work instruction?
What is the hashcode () and equals () used for?
What is the order of arraylist in java?
What is the difference between keyword and identifier?
What is a class in java?
What are the problems faced by java programmers who don't use layout managers?
What is javac in java?
What is the difference between a factory and abstract factory pattern?
What is better - 'bit-shift a value' or 'multiply by 2'?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?
What is java reflection api?
What is stack explain?