I am using D1, while you probably use D2. I have compiled the following code with -O -release -inline, with the last DMD 1.x:
import std.stdio: writefln; void foo(string s1, string s2) { string con = s1 ~ s2; writefln(con); } void main() { while(true) { string t1 = "Do"; string t2 = "That"; foo(t1, t2); } } After more than two minutes of running I don't see any increase of memory used. Don't use delete in your code, generally it's not needed. Bye, bearophile