Nullify references

GC happens when the allocation of the second array is started, and the VM notices that there is not enough memory to allocate it. No GC happens at the “array = null” line itself. It just removes the reference to the array, and the array will stay in memory for an undefined time before it is collected.