hello world script causes memory leak
This does not cause any memory leak. It simply adds entries into your Undo list, and depending on how many undo steps you have setup in preferences the Mem reading will cap out eventually and will not grow any further.