The example was without Null'ing.
The second array is created, but the reference count to the first array would not (in theory) be decremented until the 'a = ' is evaluated. the sequence internally would be like this:
alloc 40MB (array A)
refcount A += 1
reference a = array A.
alloc 40MB (array B) <- Eek, 80MB alloc'd at the moment
refcount A -=1; <- A is now free to be GC'd
refcount B+= 1
a = array B;
Adding the line 'a = null;' in between will decrement the refcount of the first array before the second alloc, so that when you new the second array, the GC can say 'I don't have the spare memory, lets garbage collect', and lo & behold there is 40MB sitting there that it can reclaim.
As to whether modern VMs would actually do this (though I would take Cas's word that he noticed an improvement), or even whether you would notice anything with objects smaller than a few MB is another question
