It's really fascinating to read this, since I've encountered similar memory issues in other languages (ruby, go, etc.). Debugging these issues is a pain.
Is there a way to make all this much easier to debug and to prevent memory issues in the first place? Is the abstraction level not quite right?