While working on my current project, I noticed that I was getting decreasing performance the longer I ran the game. I was able to narrow it down to a particle system that added many armature objects. These armatures are quickly ended, but as the game continued to run, the time it took to add each armature increased.
I’ve put together a very simple file to demonstrate the issue:
adding_armature_performance.blend (78.1 KB)
It just contains an empty that adds 10 single-bone armature objects every frame. The armatures have no actions and are immediately removed. Note that the logic usage starts out low but continues to steadily increase to unacceptably high levels (though it will occasionally drop down slightly before increasing again). Also note that if you stop and start the game engine again, the logic usage will immediately jump to the same level again before continuing to increase. This performance drop does not occur when adding normal objects as you can see by changing the added object to the cube
I don’t know exactly how the BGE handles armature objects differently from normal objects that causes this, but it seems to be something memory related since the performance drop remains until you completely close and reopen Blender. I plan on submitting a bug report, but just wanted verify that it’s not just happening on my machine first.
EDIT: Just did some additional testing. The problem seems to occur from version 2.71 and up. It does not occur on 2.70.
EDIT2: I went ahead and submitted a bug report to the tracker here.
EDIT3: Fix submitted here.