Look at the attached image, “Malloc 64 bytes” keeps accumulating and the heap allocated memory keeps rising.
It’s easy to repro by using the HelloCpp in 2.1.4(2.1.5) cocos2d-x sdk:
in AppController.mm, change the glview initializing code to:
EAGLView **__glView =
pixelFormat: kEAGLColorFormatRGB565
depthFormat: GL_DEPTH24_STENCIL8_OES
preserveBackbuffer: NO
sharegroup: nil
multiSampling: NO
numberOfSamples: 0];
** note we only change the pixel format and depth format, which should be allowed, right?
in AppDelegate.cpp
CCDirector::sharedDirector()>setDepthTest; // have to do this, otherwise the window shows nothing
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView;
pDirector>setOpenGLView(pEGLView);
then check the instrument profile and watching memory ramping up…
Is this by design or not a big issue? Let me know what is going on. Thanks.
yes I have seen this. I have reproduced it just be building a default project in 2.2 or 3.0 and running it on IOS 7 device (or simulator)
If you run on IOS 6.1 it does not show up for me.
Anyone have any ideas?
Here is what I get running my project over an extended period.
Which does look like a leak. In my case (2.2 with default settings) Instruments and XCode 5 show constantly growing memory in three allocations — IOAccellResource, CFNumber, CFString
Not sure why — there is some stuff on Google about it impacted cocos2d-iphone users around the time of the release of iOS 7.