Yeah, setting array length _may_ cause gc allocation.  Even if the new length is bigger, it may just expand the array into existing unused space.