What is guaranteed when a Java program calls System.gc()?
Correct answer A. Only that it suggests the JVM should try to reclaim memory
Explanation
The documentation describes System.gc as suggesting that the JVM expend effort to recycle unused objects, and an implementation is free to do very little. No object is promised to be freed and no timing is guaranteed. Correct programs should not depend on it, and the JVM can even be configured to ignore explicit calls.
Answer checked How we write and check questions
Discussion