I am creating thousands of display objects (specifically, shape objects) and then capturing the resulting screen rendering using display.captureScreen(). I do this so that the game engine doesn’t have to keep re-drawing the thousands of shape objects over and over again with each update.
Immediately after calling display.captureScreen()
, I remove all of the shape objects from the scene and nil
their references.
When I repeat this process, the memory used by the simulator (according to Windows Task Manager) increases by a few hundred mb each time. Eventually, more than 1 gb is used and the simulator crashes with the console output: The stdin connection has closed.
What is causing this? Why is so much memory being used?
I remove all display objects directly after display.captureScreen()
, so what’s the problem here?