Is guaranteed that the garbage collection will start after calling Runtime.getRuntime().gc()?
In java the garbage collection is run by the virtual machine, not the user. Method call gc() - this is only a request for the garbage collection. The specification does not regulate the collection time and can not guarantee whether it will start at all.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Sign Up Now
or Subscribe for future quizzes