Your patch seems to work fine. Builds and runs w/ no problems. After about 24 hours, memory use (vsize) has remained around 1MB.