Does the StringObject.reserve() function prevent memory fragmentation/leaks?
Reserving space will help reduce memory fragmentation, but much of what else you are doing is swamping that small improvement you have made.

The biggest area of concern is your cutString function, which you have omitted from your code above.  Passing a String as a parameter, modifying it, and then returning it again, ends up in new String objects being created and destroyed multiple times, which will make a mess of your heap.

Instead you should pass a String object by reference, and modify that object in-place. No need to return anything.

void cutString(String &amp;theString) {
    // Modify theString here.
}


Of course, what you do in cutString could cause more problems - you should include that function in your code above so we can check it out.