I think I ran into the same thing with one of the mock questions I wrote. I thought that as long as the variable was in scope, it would not be GCed, in spite of the fact that execution could not possibly return to the code using the variable. Somebody objected to it so we tried some experiments.
As I recall, the JDK 1.0 level compiler/runtime would not GC as long as the
thread was in the method but later versions apparently could recognize that the variable could be GCed. A big surprise to me.
Bill