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 do you understand by access specifiers in Java?
Can you change array size in java?
What is a treeset in java?
what is function overloading in java?
What is the default value of the local variables?
Explain the different forms of polymorphism?
Can singleton class be inherited in java?
What happens when you add a double value to a string?
What are the different types of inheritance in java?
What are void pointers?
Does printwriter create a file?
What is tochararray in java?
What is java lang object?
What is the purpose of javac exe?
What is the default size of arraylist in java?