http://blog.csdn.net/haomengzhu/article/details/27693365
The engine maintains a recycling pool, and all Autorelease objects are added to the pool.
Multiple auto-recycle pools are arranged into a stack structure, and when we manually create the recycle pool, the recycle pool is pushed to the top of the stack, and the Autorelease object is added only to the top pool. When the recovery pool of the when top layer is ejected, all objects inside it are freed once, and then the Autorelease objects that appear are added to the next pool.
Cocos2d-x has ensured that the Recycle pool is released once each frame ends and a new recycle pool is created before the next frame starts, but we should also
Considering that the recycle pool itself maintains a list of objects that will perform the release operation, if a large number of Autorelease objects are generated within a frame, the performance of the Recycle pool will degrade.
Therefore, before and after generating Autorelease object-dense areas (usually loops), it is better to manually create and release a recycling pool.
Step A
Obj1->autorelease ();
Obj2->autorelease ();
Step b
Poolmanager::getinstance ()->push (this);
Step c
for (int i=0; i<n; i++) {
Obj_array[i]->autorelease ();
}
Step d
Poolmanager::getinstance ()->pop ();
Step E
Obj3->autorelease ();
Build Your own recycling pool