<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: memory - Recent Posts</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/memory</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 02:31:11 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/memory" rel="self" type="application/rss+xml" />

		<item>
			<title>riq on "Is it possible to mix RGBA8888 and RGBA4444 in the same scene/layer?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29122#post-143495</link>
			<pubDate>Thu, 09 Feb 2012 19:37:53 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">143495@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>You can mix 4444, 8888, 5551, 565, LA88, L8, etc... textures.</p>
<p>The PVR images are not affected by the  <code>[CCTexture2D setDefaultAlphaPixelFormat:]</code> method.
</p></description>
		</item>
		<item>
			<title>neigaard on "Is it possible to mix RGBA8888 and RGBA4444 in the same scene/layer?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/29122#post-143489</link>
			<pubDate>Thu, 09 Feb 2012 19:28:56 +0000</pubDate>
			<dc:creator>neigaard</dc:creator>
			<guid isPermaLink="false">143489@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi</p>
<p>I would like to use RGBA4444 in some of my PVR textures and RGBA8888 in others of my PVR textures. No as I understand it the PVR includes information about wether it is RGBA8888 or RGBA4444, but will cocos2d work well with this also reducing memory usage on the RGBA4444 textures and still render my RGBA8888 textures in lovely 32 bit?</p>
<p>Thank you<br />
Søren
</p></description>
		</item>
		<item>
			<title>yadongliu on "Cut the Rope style intro video"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28851#post-142219</link>
			<pubDate>Wed, 01 Feb 2012 22:27:32 +0000</pubDate>
			<dc:creator>yadongliu</dc:creator>
			<guid isPermaLink="false">142219@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>We use CCVideoPlayer to play a mp4 video in our intro scene. It worked well for us in one of our apps. </p>
<p>CCVideoPlayer is part of cocos2d-extension.
</p></description>
		</item>
		<item>
			<title>iUridium on "Cut the Rope style intro video"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28851#post-142187</link>
			<pubDate>Wed, 01 Feb 2012 18:22:59 +0000</pubDate>
			<dc:creator>iUridium</dc:creator>
			<guid isPermaLink="false">142187@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Great assets! Thanks @<a href='http://www.cocos2d-iphone.org/forum/profile/145'>bradparks</a>!
</p></description>
		</item>
		<item>
			<title>bradparks on "Cut the Rope style intro video"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28851#post-142156</link>
			<pubDate>Wed, 01 Feb 2012 15:37:10 +0000</pubDate>
			<dc:creator>bradparks</dc:creator>
			<guid isPermaLink="false">142156@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>cool.... and i forgot to mention that you have to only use the SWF format... that thread talk about converting the SWF's into textures, but for your purposes you'd ignore that whole bit and just stick with native SWF's.
</p></description>
		</item>
		<item>
			<title>callispo on "Cut the Rope style intro video"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28851#post-142153</link>
			<pubDate>Wed, 01 Feb 2012 15:23:42 +0000</pubDate>
			<dc:creator>callispo</dc:creator>
			<guid isPermaLink="false">142153@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks @<a href='http://www.cocos2d-iphone.org/forum/profile/145'>bradparks</a>, looks interesting :) I'll definitely check them out tomorrow and get back to you with updates :)
</p></description>
		</item>
		<item>
			<title>bradparks on "Cut the Rope style intro video"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28851#post-142151</link>
			<pubDate>Wed, 01 Feb 2012 15:12:56 +0000</pubDate>
			<dc:creator>bradparks</dc:creator>
			<guid isPermaLink="false">142151@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>hey.... you can use Adobe Flash SWF's in Cocos2d for stuff like that.... That would be low overhead for memory, and would probably work great for cut scenes... I haven't tried it though, but it should work. When you publish your Flash SWF's, they can't include Actionscript, and they should probably publish to something like Flash 3 or something like that.... This thread talks about it in detail:</p>
<p><a href="http://www.cocos2d-iphone.org/forum/topic/24542" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/24542</a></p>
<p>with I *beleive* the best versions of the referenced source online available at GitHub here:<br />
<a href="https://github.com/talentless" rel="nofollow">https://github.com/talentless</a></p>
<p>specifically, I think you need the following:<br />
<a href="https://github.com/talentless/MonkSWF" rel="nofollow">https://github.com/talentless/MonkSWF</a><br />
<a href="https://github.com/talentless/cocos2d-iphone-extensions-swf" rel="nofollow">https://github.com/talentless/cocos2d-iphone-extensions-swf</a><br />
<a href="https://github.com/talentless/MonkVG" rel="nofollow">https://github.com/talentless/MonkVG</a></p>
<p>Hope it helps! Let us know how you make out.... I haven't looked at this since that thread was busy a couple of months ago, but will probably get back to it sometime within the next month myself....
</p></description>
		</item>
		<item>
			<title>callispo on "Cut the Rope style intro video"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28851#post-142149</link>
			<pubDate>Wed, 01 Feb 2012 14:55:45 +0000</pubDate>
			<dc:creator>callispo</dc:creator>
			<guid isPermaLink="false">142149@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I was wondering, the intro animation of Cut the Rope, in which theres a knock on the door, and Om Nom appears in a box, etc. How is this made? Is there any way I can embed videos in my game like that, because making a video like that, by using CCSprites and CCAnimation would consume a lot of memory.
</p></description>
		</item>
		<item>
			<title>pfg2009 on "Getting texture pixels without using glReadPixels()"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28677#post-141312</link>
			<pubDate>Thu, 26 Jan 2012 04:23:39 +0000</pubDate>
			<dc:creator>pfg2009</dc:creator>
			<guid isPermaLink="false">141312@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Here is some more interesting data that doesn't seem to make much sense.  I ran the same glReadPixels() test on two different devices - a gen 2 iPod Touch running iOS4.2 and gen &#60;latest&#62; iPod Touch running iOS 5.0.1.  The test simply created an empty CCRenderTexture of 512x512 pixels, calling glReadPixels on it every frame and measuring the delay.  Here is the code:</p>
<pre><code>if (tex == nil) {
		tex = [[CCRenderTexture renderTextureWithWidth:512 height:512] retain];
	}

	[tex begin];

	float x = 0;
	float y = 0;
	float w = 512;
	float h = 512;

	GLubyte* pixels = malloc(w * h * sizeof(GLubyte) * 4);
	glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);

	[tex end];
	free(pixels);</code></pre>
<p>On the older device running iOS4.2, the glReadPixels call (which I measured independent of the other calls (mallocs and such)) hovered at at around 25ms.  On the new device, the glReadPixels call lasted a whooping (and consistent) 100ms.</p>
<p>Anyone know why that might be?
</p></description>
		</item>
		<item>
			<title>pfg2009 on "Getting texture pixels without using glReadPixels()"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28677#post-141309</link>
			<pubDate>Thu, 26 Jan 2012 03:23:17 +0000</pubDate>
			<dc:creator>pfg2009</dc:creator>
			<guid isPermaLink="false">141309@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks for the reply and code sample, @<a href='http://www.cocos2d-iphone.org/forum/profile/11274'>araker</a>!  And you are totally right about the texture binding - my bad.</p>
<p>I found this interesting post on <a href="http://stackoverflow.com/questions/7895856/pixel-formats-cvpixelbufferrefs-and-glreadpixels">CVPixelBufferRefs</a> supposedly part of iOS5 but I haven't dug into those yet (and according to the post, they only have hardware support on the new devices, reverting to glReadPixels on older hardware).  Most of this is way over my head in terms of my knowledge of OpenGL, but if I sniff out something interesting, I'll let you know.</p>
<p>EDIT: as far as the type of processing I need - I was looking at the possibility of rendering dynamic 2D shadows based on programmatically generated textures.  I believe this would be an easy accomplishment with shaders, but I'm not quite ready to jump onto OpenGL ES 2.0 just yet.  So, I was sniffing around to see if I could hack something together on the CPU instead.
</p></description>
		</item>
		<item>
			<title>araker on "Getting texture pixels without using glReadPixels()"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28677#post-141308</link>
			<pubDate>Thu, 26 Jan 2012 03:01:03 +0000</pubDate>
			<dc:creator>araker</dc:creator>
			<guid isPermaLink="false">141308@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>We all wish that glReadPixels could be faster. It's not possible to use a pixel array like in CCMutableTexture because the render texture is a color buffer and not a texture, the texture is generated from the color buffer, but the manipulation happens on the buffer. </p>
<p>The buffer itself can't be accessed directly, only glDraw commands can write to it and glReadPixels can retrieve the color values. The texture can only read the buffer, but not manipulate it.</p>
<p>Where exactly do you use that code? glReadPixels reads values from a color buffer, not from a texture. So the texture bind calls aren't necessary. </p>
<p>I usually read the buffer like this..<br />
<pre><code>GLubyte* pixels = malloc(section_width * section_height * sizeof(GLubyte) * 4);
CCRenderTexture* myTexture = ...;
[myTexture begin];
  [someSprite visit];
  glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
[myTexture end];</code></pre>
<p>One other thing that can speed things up a bit is using a smaller render textures and scale the sprite when needed. </p>
<p>Depending on where you need the color values for, there may be ways to avoid using glReadPixels. What exactly do you mean with additional processing?
</p></description>
		</item>
		<item>
			<title>pfg2009 on "Getting texture pixels without using glReadPixels()"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28677#post-141302</link>
			<pubDate>Thu, 26 Jan 2012 02:11:03 +0000</pubDate>
			<dc:creator>pfg2009</dc:creator>
			<guid isPermaLink="false">141302@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have CCRenderTexture into which I draw stuff using the following method:</p>
<pre><code>CCRenderTexture* myTexture = ...;
[myTexture begin];
[someSprite visit];
[myTexture end];</code></pre>
<p>Occasionally, I want to peek back into this texture and read a bunch of pixels to do some additional processing with them.  I can accomplish this with glReadPixels() thusly:</p>
<pre><code>GLubyte* pixels = malloc(section_width * section_height * sizeof(GLubyte) * 4);
glBindTexture(GL_TEXTURE_2D, textureName);
glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
glBindTexture(GL_TEXTURE_2D, nil);</code></pre>
<p>This works, but it's slow for my needs and the question I have is whether I can accomplish this same task faster, by avoiding glReadPixels somehow.  Any suggestions?</p>
<p>I figured, I could keep a pointer to the raw data representing the texture in way similar to CCMutableTexture2D that has been used by folks on this forum (for example <a href="http://www.cocos2d-iphone.org/forum/topic/11745">here</a>).  In the CCMutableTexture2D, that data is passed to the GPU using glTexImage2D().  Does that method <strong>copy</strong> the data into GPU's memory or does it simply direct GPU to <strong>use</strong> that piece of memory without duplicating it?  If it's the former, I could just look through the raw data as it's updated via the CCRenderTexture begin/end method without having to call glReadPixels().  If it's the latter, I'm out of ideas.</p>
<p>Any help is much appreciated!
</p></description>
		</item>
		<item>
			<title>rgaino on "Removing unused sprite sheet not freeing up memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28075#post-141284</link>
			<pubDate>Wed, 25 Jan 2012 23:09:55 +0000</pubDate>
			<dc:creator>rgaino</dc:creator>
			<guid isPermaLink="false">141284@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've trying to fix this issue for days now without success.  The summary is that I have a character in my game that can have one of 8 possible textures. So I have 8 different spritesheets (TexturePacker, pvr.ccz) and randomly I pick one. This class eventually gets released and a new one is created. What happens is that every time that happens the memory allocated increases by around 4MB up until the point where the 8 spritesheets are loaded, then it stops growing.</p>
<p>This class has also methods for animating the sprite but they are not being called. I tried to isolate the problem by commenting out all functionality down to a point where all the class does is load the sprite sheet when it's created and remove it when it's released:</p>
<p><code><br />
    // right after init<br />
    [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:spriteSheetFileName];<br />
</code><br />
<code><br />
    //right before dealloc<br />
    [[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFramesFromFile:spriteSheetFileName];<br />
    [[CCTextureCache sharedTextureCache] removeTextureForKey:textureFileName];<br />
</code></p>
<p>But memory still keeps growing.</p>
<p>I can't use removeUnusedSpriteFrames or removeUnusedTextures because that removes textures I intend to use at some point and I need it pre-loaded.</p>
<p>Does anyone have any idea what can possibly be happening? Anyway I can debug this further?</p>
<p>Thank you!
</p></description>
		</item>
		<item>
			<title>Birkemose on "Invisible sprites and memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28648#post-141143</link>
			<pubDate>Wed, 25 Jan 2012 12:04:13 +0000</pubDate>
			<dc:creator>Birkemose</dc:creator>
			<guid isPermaLink="false">141143@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Instruments speaks a language, that only the high priests of programming understands.<br />
The rest of us will have to rely on the fact, that loading a texture, will immediately chew away our precious memory :)
</p></description>
		</item>
		<item>
			<title>MasterP on "Invisible sprites and memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28648#post-141141</link>
			<pubDate>Wed, 25 Jan 2012 12:00:02 +0000</pubDate>
			<dc:creator>MasterP</dc:creator>
			<guid isPermaLink="false">141141@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Thanks for your reply.  I was using Instruments/Allocations widget and looking at the top line which shows all memory allocated from my app.  It seemed to go up and down depending on the Visible property.  Using the Activity Monitor widget, I see that alot of virtual memory is being used depending on how many images I load, regardless of the Visible property.
</p></description>
		</item>
		<item>
			<title>Birkemose on "Invisible sprites and memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28648#post-141127</link>
			<pubDate>Wed, 25 Jan 2012 11:08:35 +0000</pubDate>
			<dc:creator>Birkemose</dc:creator>
			<guid isPermaLink="false">141127@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am not sure what you are reading.<br />
When you create the sprite, the texture is loaded into the cache. Setting visible will have no impact on memory consumption.</p>
<p>So the answer to your question is: Yes, you will want to preload as much as possible, to avoid loading textures on the fly, and no, there is no memory saved by setting visible to false.
</p></description>
		</item>
		<item>
			<title>MasterP on "Invisible sprites and memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28648#post-141123</link>
			<pubDate>Wed, 25 Jan 2012 10:11:35 +0000</pubDate>
			<dc:creator>MasterP</dc:creator>
			<guid isPermaLink="false">141123@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I notice that when I load a sprite from a file (the size is 512x512 and is PVRTC), instruments indicates the memory usage has gone up, as it should.  But, if I set the sprite visible property to false right away after loading, the memory usage goes up only slightly.  Of course, when I set the visible property back to true again, the memory usage goes back up where it was before.  Is this memory reading accurate?  If so, does this mean i can load all my images up front and set only those images which are needed right now to visible?<br />
Thanks.
</p></description>
		</item>
		<item>
			<title>TacoGraveyard on "About release and retain..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28629#post-141044</link>
			<pubDate>Tue, 24 Jan 2012 19:02:24 +0000</pubDate>
			<dc:creator>TacoGraveyard</dc:creator>
			<guid isPermaLink="false">141044@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p><a href="http://developer.apple.com/library/mac/#" rel="nofollow">http://developer.apple.com/library/mac/#</a><a href='http://www.cocos2d-iphone.org/forum/tags/documentation'>documentation</a>/Cocoa/Conceptual/MemoryMgmt/Articles/MemoryMgmt.html
</p></description>
		</item>
		<item>
			<title>Karl on "About release and retain..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28629#post-141038</link>
			<pubDate>Tue, 24 Jan 2012 18:44:06 +0000</pubDate>
			<dc:creator>Karl</dc:creator>
			<guid isPermaLink="false">141038@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p><a href="http://developer.apple.com/library/mac/#" rel="nofollow">http://developer.apple.com/library/mac/#</a><a href='http://www.cocos2d-iphone.org/forum/tags/documentation'>documentation</a>/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html</p>
<p><a href="http://developer.apple.com/library/mac/#" rel="nofollow">http://developer.apple.com/library/mac/#</a><a href='http://www.cocos2d-iphone.org/forum/tags/documentation'>documentation</a>/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html
</p></description>
		</item>
		<item>
			<title>Bahamut on "About release and retain..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28629#post-141029</link>
			<pubDate>Tue, 24 Jan 2012 17:40:55 +0000</pubDate>
			<dc:creator>Bahamut</dc:creator>
			<guid isPermaLink="false">141029@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I think im a bit confused about how it works.<br />
What is a "reference count"? What is release and retain?<br />
Do i have to release the object everytime i "use" it?</p>
<p>Where can i read more about properties? (@property (nonatomic, retain), etc.)
</p></description>
		</item>
		<item>
			<title>JC on "Removing unused sprite sheet not freeing up memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28075#post-140371</link>
			<pubDate>Fri, 20 Jan 2012 09:23:24 +0000</pubDate>
			<dc:creator>JC</dc:creator>
			<guid isPermaLink="false">140371@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>if you want to completely control memory usage from sprite sheet, the only way i found is to :</p>
<p>begin : use addSpriteFramesWithFile<br />
end :  use removeSpriteFramesFromFile + removeTextureForKey</p>
<p>for removeTextureForKey, be warn that you need to give the EXACT texture name (like XXX-hd.png or XXX-ipad.png) it doesn't complete it automatically like in loading :(</p>
<p>if you have memory use buy your sprite sheet after that, it's probably because your sprite are not destroyed or something like that.
</p></description>
		</item>
		<item>
			<title>rgaino on "Removing unused sprite sheet not freeing up memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28075#post-140305</link>
			<pubDate>Fri, 20 Jan 2012 00:34:31 +0000</pubDate>
			<dc:creator>rgaino</dc:creator>
			<guid isPermaLink="false">140305@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have also tried to explicitly remove the texture with:</p>
<p>[[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFramesFromFile: ];<br />
[[CCTextureCache sharedTextureCache] removeTextureForKey: ];</p>
<p>But still won't free up the memory...
</p></description>
		</item>
		<item>
			<title>rgaino on "Removing unused sprite sheet not freeing up memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28075#post-140299</link>
			<pubDate>Fri, 20 Jan 2012 00:12:50 +0000</pubDate>
			<dc:creator>rgaino</dc:creator>
			<guid isPermaLink="false">140299@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi FogleBird.<br />
No, they don't. removeSpriteFramesFromFile:file will remove all sprite frames, including the ones I am planning to use and I want to have pre-loaded. removeUnusedTextures will not free up the memory.</p>
<p>It just keeps increasing...
</p></description>
		</item>
		<item>
			<title>FogleBird on "Removing unused sprite sheet not freeing up memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28075#post-140136</link>
			<pubDate>Thu, 19 Jan 2012 00:19:07 +0000</pubDate>
			<dc:creator>FogleBird</dc:creator>
			<guid isPermaLink="false">140136@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Do either of these help?</p>
<p>		[[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFramesFromFile:file];<br />
		[[CCTextureCache sharedTextureCache] removeUnusedTextures];
</p></description>
		</item>
		<item>
			<title>col55 on "Removing unused sprite sheet not freeing up memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28075#post-140114</link>
			<pubDate>Wed, 18 Jan 2012 21:38:48 +0000</pubDate>
			<dc:creator>col55</dc:creator>
			<guid isPermaLink="false">140114@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Check out some of my threads I had the same problem and eventually solved it it was a special way I had to use to unload sprite sheet
</p></description>
		</item>
		<item>
			<title>rgaino on "Removing unused sprite sheet not freeing up memory"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28075#post-140104</link>
			<pubDate>Wed, 18 Jan 2012 21:06:53 +0000</pubDate>
			<dc:creator>rgaino</dc:creator>
			<guid isPermaLink="false">140104@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Bump. I'm still struggling with this issue. I made my " human" class not a subclass of CCSprite anymore but rather just containing a CCSprite object with itself. </p>
<p>I have defined the 2 methods below that are called when I'm done with that instance. The methods are being called, but the memory keeps increasing every time a new HumanSprite is created.</p>
<p><code><br />
-(void) cleanUp<br />
{<br />
    [_humanSprite removeFromParentAndCleanup:YES];</p>
<p>    NSLog(@"Removing sprite sheet for human number %03d", humanId);<br />
    [[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFramesFromFile:[NSString stringWithFormat:@"HumanAnimations_%03d.plist", humanId]];<br />
}</p>
<p>-(void) dealloc<br />
{<br />
    NSLog(@"On dealloc for humanSprite");<br />
    [super dealloc];<br />
}<br />
</code></p>
<p>And here's how I create the CCSprite that is held on this class:</p>
<p><code><br />
    HumanSpriteRandomizer *humanSpriteRandomizer = [HumanSpriteRandomizer getInstance];<br />
    humanId = [humanSpriteRandomizer getNextHumanId];</p>
<p>    NSLog(@"Rendering human number %03d", humanId);</p>
<p>    CCSpriteBatchNode *spriteSheet = [CCSpriteBatchNode batchNodeWithFile: [NSString stringWithFormat:@"HumanAnimations_%03d.pvr.ccz", humanId]];<br />
    [scene addChild:spriteSheet z:10];<br />
    [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:[NSString stringWithFormat:@"HumanAnimations_%03d.plist", humanId]];</p>
<p>    CCSpriteFrame *frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"human_%03d_standing.png", humanId]];</p>
<p>    _humanSprite = [CCSprite spriteWithSpriteFrame:frame];<br />
    [_humanSprite setPosition:ccp(642, 400)];<br />
    [spriteSheet addChild:_humanSprite z:10];<br />
</code></p>
<p>That's a big problem for me right now, anyone has any idea why it doesn't free up the memory after I remove the sprite sheet?</p>
<p>Thanks!
</p></description>
		</item>
		<item>
			<title>Martin on "Background music size, what is too large?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28400#post-139846</link>
			<pubDate>Tue, 17 Jan 2012 12:56:13 +0000</pubDate>
			<dc:creator>Martin</dc:creator>
			<guid isPermaLink="false">139846@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>If you stream the music with AVAudioPlayer you should not get out of memory crashes regardless of the filesize because it streams the music.
</p></description>
		</item>
		<item>
			<title>letmeknow on "Background music size, what is too large?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28400#post-139841</link>
			<pubDate>Tue, 17 Jan 2012 10:05:34 +0000</pubDate>
			<dc:creator>letmeknow</dc:creator>
			<guid isPermaLink="false">139841@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>less than 5mb mp3 file is ok. You don't need too high quality bg music, people don't buy casual game (except music game) because of the bg music.
</p></description>
		</item>
		<item>
			<title>JC on "Background music size, what is too large?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28400#post-139839</link>
			<pubDate>Tue, 17 Jan 2012 09:58:13 +0000</pubDate>
			<dc:creator>JC</dc:creator>
			<guid isPermaLink="false">139839@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>it depend on how many data you have on memory (sprites etc...).</p>
<p>i think that there is no general maximum background music size.</p>
<p>if you make a music game, you will have high quality music but lite graphics.<br />
if you make a FTP shooter, you will have high graphics and medium/low quality music.
</p></description>
		</item>
		<item>
			<title>riq on "Release necessary after removeFromParentAndCleanup:YES?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28404#post-139815</link>
			<pubDate>Tue, 17 Jan 2012 08:17:46 +0000</pubDate>
			<dc:creator>riq</dc:creator>
			<guid isPermaLink="false">139815@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>the object is released when the reference count == 0.<br />
<code>removeFromParent</code> will decrease the reference by 1.<br />
And if <code>cleanup == YES</code> it will remove all scheduled timers / actions for that particular node (further reducing the reference count it case times/actions were scheduled)
</p></description>
		</item>

	</channel>
</rss>

