Strings are Immutable, therefore every time you make a change to it, it creates a new string object. I would guess that creating 100000 new string objects in short order is overwhelming the garbage collector as there is no time in between the iterations for it to run.