Howdy -- for the purposes of the exam, I concur with the other folks - NO GUARANTEES. However, in practice, most VMs do respond, so I used it in the past (especially before HotSpot when it *really* made a huge difference) to help prevent the garbage collector from running at an "inappropriate" time. As a game developer then, I defined "inappropriate" as "right in the middle of an intense animation scene." Like, the last thing you want is the guy to be running away from the alien Tiger and then suddenly freeze -- mid-stride -- while gc happens. So I always liked to invoke System.gc() before something that needs to proceed smoothly, OR when I know that the user will not notice. For example, when the user is reading a Help Screen, that is a nice time for gc to happen.
But with HotSpot, this really does not seem to matter much anymore.
I wish I had a garbage collection system at home. But it would have to be smart enough to know that -- even though I still have a live reference to something -- I will never use it/wear it/eat it again if my life depends on it
