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
Explain the scope of a variable.
What is string builder in java?
List the interfaces which extends collection interface?
How does thread synchronization occurs inside a monitor?
What is the set interface in java programming?
How do you escape a string?
Can java run on google chrome?
can I implement my own start() method? : Java thread
Is main a keyword in java?
Is a method a procedure?
What is an example of declaration?
Is vector ordered in java?
Why is multiple inheritance not supported in java?
What are the restriction imposed on a static method or a static block of code?
what is synchronization? : Java thread