GROOVY-5934: java.lang.OutOfMemoryError through Iterator.collectEntries and others