If the program runs for a while and you fly around heaps it will eventually use up all the system memory. Implement some kind of memory/object flush every so often, maybe based on the size of objects?