Which of the following statements about garbage collection are true?
A) The garbage collector runs in low memory situations B) You can run the garbage collector when ever you want. C) When it runs, it releases the memory allocated by an object, which is no more in use. D) Garbage collector immediately runs when you set the references to null.
I expect the answer to be C. But given answer is A,C. Not convinced about A. Garbage collector frees memory. But does it have something to do with low memory situation?
The main purpose of having a garbage collector is to free up space so that more memory is available for applications.. So the option is kinda obvious..
Hi, As always said, please mention the link of this mock test or atleast the name of the mock test. Else it is very hard for us to check on that.
Even I find choice A to be a less appropriate one. As mentioned in K&B book, one thing is for sure. The Garbage Collector will run once, DEFINITELY before your JVM crashes due to low memory.
I dont accept choice A for sure anyways. Hope you dont get such ambiguous questions in your exam
--------------------------------------------------------------------------- The main purpose of having a garbage collector is to free up space so that more memory is available for applications.. So the option is kinda obvious.. --------------------------------------------------------------------------
But garbage collector runs in high memory situations too..that's why I'm against choice A.
----------------------------------------------------------------------------please mention the link of this mock test or atleast the name of the mock test. Else it is very hard for us to check on that. --------------------------------------------------------------------------- http://www.javacaps.com/scjp_mockexams1.html