Pipeline crashes after a few 10000 frames


I am using panda3d to generate different views of an object model. For this, I load the egg file, set the hpr on the object and render its depth image, set a new hpr, render, and so on. However, after a few 10000 rendered frames, I get the following error:

Memory usage overflow for type RenderState.

Any ideas where to look?
I am using panda3d 1.9.1 with python on Ubuntu 14.04


You the result of the render, save it on your hard drive and clear the variable every frame.

To diagnose the issue, you could also fire up pstats and see if anything is steadily increasing every frame to the point of filling up memory.

This could be a memory leak, or a state cache overflow, or an overallocation attempt. Since it has to do with RenderStates, you could try disabling the render state cache and see if that fixes it:

state-cache #f

Does your program use its own main loop and/or do you avoid ShowBase? Normally, when using base.run(), Panda calls this every frame:


You may need to call this manually between renders.


thanks for your reply. I do not use the ShowBase.run(), so adding:


after each rendering did the job. No more crashes :wink: