We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Uncontrolled memory consumption (probably leak) while doing nothing!
Uncontrolled memory consumption (probably leak) while doing nothing!
If you create a project by tools/project-creator/create_project.py, the problem will be appeared.
After debug the project, the reason of the bug is in AppController.mm:
<pre>
// Init the CCEAGLView
CCEAGLView *eaglView = [CCEAGLView viewWithFrame: [window bounds]
pixelFormat: kEAGLColorFormatRGB565
depthFormat: GL_DEPTH24_STENCIL8_OES
preserveBackbuffer: NO
sharegroup: nil
multiSampling: NO
numberOfSamples: 0 ];
</pre>
When the value of "pixelFormat" is kEAGLColorFormatRGB565, the problem appeared.
If change kEAGLColorFormatRGB565 to kEAGLColorFormatRGBA8, everything works well.
I don't know the real reason of the problem.
Then I looked up stuffs from google and I found this post.
@Riq
I just downloaded iOS simulator 6.1 and took a test. The test result is :
1. kEAGLColorFormatRGBA8 works well on both iOS simulator 6.1 & 7.0.
2. kEAGLColorFormatRGB565 works well on iOS simulator 6.1, but the memory always increase on iOS simulator 7.0.
So I think it's a bug of iOS 7.0. Maybe we can suggest developers using kEAGLColorFormatRGBA8 to avoid the problem.
@Riq,
Yes, I took a test on device with iOS 7.0, the bug is not happened.
Do you mean what we should to do is telling developers it's only a bug of iOS simulator 7.0 ?
The result on simulator ios 7.0, the memory consumption increase very quickly, for about 1Mb for 1 min.
I tested testCpp on iphone4s, ios 7.0 version. The memory consumption increase much slowly, about 0.1MB for 10-15seconds. And it will only increased by 0.2MB totally.
@unoave. can you give a statistic of memory consumption increase on IOS7.0.4?
As @Bin said. When I switched the format from RGB565 to RGBA8888, it will not increase any more. If we use ios6.1 simulator, the memory consumption will never increase.
I believe there is a bug in the new renderer of 3.0beta2.
When I Profile Hello cpp iOS in Xcode memory consumption increases with speed of about 100kb per second and it is never released!
After 15min of idling Hello cpp iOS consumes about 150mb of memory!
Please check it out! It is big!