jQuery in Action, 2nd edition*
The moose likes Mock Exam Errata and the fly likes javacaps mock 1 Q:11 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "javacaps mock 1 Q:11" Watch "javacaps mock 1 Q:11" New topic
Author

javacaps mock 1 Q:11

Haining Mu
Ranch Hand

Joined: Jun 01, 2001
Posts: 51
11. Which 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.

Answer: A.C
feel a little bit not comfortable with A, can somebody explain a little bit? does its wording has problem?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
When memory gets "low" (however low is defined in the JVM) then garbage collection will automatically be kicked off.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Haining Mu
Ranch Hand

Joined: Jun 01, 2001
Posts: 51
Originally posted by Thomas Paul:
When memory gets "low" (however low is defined in the JVM) then garbage collection will automatically be kicked off.

so, if memory NOT gets 'low', gc will NOT be suggested to run unless explicitly call?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
GC always runs as a low priority thread so if nothing else is happening, garbage collection can run even if memory is not "low".
 
Consider Paul's rocket mass heater.
 
subject: javacaps mock 1 Q:11
 
Similar Threads
mock q on garbage collection
Gc question
garbage collection
GC Question
Garbage Collection