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 covariant return type?
How to check if linked list contains loop in java?
What is empty string literal in java?
Can we override the static method?
Why collection is called framework in java?
What is difference between wait and notify in java?
What is the difference between variable & constant?
What do you mean by local variable and instance variable?
Which eclipse is best for java?
what is synchronization? : Java thread
What is an immutable object?
What is multithreading and its advantages?
How can we create a synchronized collection from given collection?
Can you use abstract and final both with a method?
How do you create immutable object in java?