ZhouWeikuan / cocos2d

cocos2d for android, based on cocos2d-android-0.82, and now ported from cocos2d-iphone 0.99.4. The googlecode address is here: http://code.google.com/p/cocos2d-android-1/ . There are several demos to watch.
610 stars 291 forks source link

Memory issure again!!! #7

Open fox815 opened 13 years ago

fox815 commented 13 years ago

CCTexutre2d have using "GLResourceHelper.GLResourceLoader mLoader". So,when we set ccsprite = null,the ccsprite have not realize release,because "CCTexutre2d.finalize" will not be called.Your could add code about "GLResourceHelper.sharedHelper().removeLoader(mLoader);" in CCTexutre2d.

Thank you

opengenius commented 13 years ago

Thanks for feedback. I'll redesign this soon.

fox815 commented 13 years ago

you could add ref_count in CCTexture2D,and add "release" function Thank you

makala commented 13 years ago

hi fox815:

Somebody sounds he fix the memory leak, he told me that he resolve the memory leaks when call the CCLabel.setString method.

He give me the source code, but I have not test yet. Could you please test the source code with this mail appendix.

Thank you

2011-04-20

makala.cn

发件人: fox815 发送时间: 2011-04-16 23:24:18 收件人: makala.cn 抄送: 主题: [GitHub] Memory issure again!!! [ZhouWeikuan/cocos2d GH-7]

CCTexutre2d have using "GLResourceHelper.GLResourceLoader mLoader". So,when we set ccsprite = null,the ccsprite have not realize release,because "CCTexutre2d.finalize" will not be called.Your could add code about "GLResourceHelper.sharedHelper().removeLoader(mLoader);" in CCTexutre2d.

Thank you

Reply to this email directly or view it on GitHub: https://github.com/ZhouWeikuan/cocos2d/issues/7

fox815 commented 13 years ago

to makala

I had fixed this memory leak and send source code to you before.But I found some new issue in android 2.1 about reload texture,so i hope the author to fix it.

Thank you

genevictor commented 13 years ago

Hi makala,

Could you please post the code of the CCLabel.setString fix? The problem cause me a big trouble. Eclipse's memory analyzer points out that GLResourceHelper.reloadMap is holding some CCLabel as hash values, which are considered strong references. The labels are too strongly referencing the textures.

Many thanks.

tjhiggins commented 13 years ago

Please post a fix this is still a major issue for us.

BMR11 commented 13 years ago

Hi, Facing big performnace issues due to this problem. FPS keeps dropping, and at the end it crashes. Please can anyone help me how to solve this? Thanks in advance.

ccrazycoder commented 12 years ago

I am also facing this same issue , played game for 2-3 times and after that it get crashed without giving any error message.

Memory management guidance will help a lot.

opengenius commented 12 years ago

which issue? CCLabel doesn't keep ref anymore. Try eclipse memory analizer, may be you are storing some ref in your code.