<?xml version="1.0" encoding="UTF-8"?><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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Cocoa Tutorial: Fixing Memory Leaks With Instruments</title>
	<atom:link href="http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/</link>
	<description>Taglines are for Windows programmers</description>
	<lastBuildDate>Tue, 09 Mar 2010 15:03:03 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: IPhone Memory Management &#171; Imamraza&#8217;s Blog</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-1284</link>
		<dc:creator>IPhone Memory Management &#171; Imamraza&#8217;s Blog</dc:creator>
		<pubDate>Thu, 25 Feb 2010 11:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-1284</guid>
		<description>&lt;p&gt;[...] http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/  Possibly related posts: (automatically generated)IPhone development on Windows machineMore Dev-friendly Tools for iPhone Emerge Pointing to Apple&#8217;s Achilles&#8217;&#8230;iPhone Memory ManagementMemory Leaks and iPhone App Development [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/" rel="nofollow">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/</a>  Possibly related posts: (automatically generated)IPhone development on Windows machineMore Dev-friendly Tools for iPhone Emerge Pointing to Apple&rsquo;s Achilles&rsquo;&#8230;iPhone Memory ManagementMemory Leaks and iPhone App Development [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: DingoJunior</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-1185</link>
		<dc:creator>DingoJunior</dc:creator>
		<pubDate>Sun, 29 Mar 2009 03:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-1185</guid>
		<description>&lt;p&gt;Thanks for the blog entry! Instruments/leaks was confusing me until I stumbled across this!&lt;/p&gt;

&lt;p&gt;However... I am also experiencing a memory leak using AVAudioPlayer. Thanks to Instruments/Leaks and this blog, every other memory leak in my program has been tracked down and quashed, but not this one. With this bit of code:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;&lt;code&gt;NSURL *backgroundMusicURL = [ NSURL fileURLWithPath: [ [ NSBundle mainBundle ] pathForResource: @&quot;test&quot; ofType: @&quot;mp3&quot; ] ];
self.backgroundMusic = [ [ AVAudioPlayer alloc ] initWithContentsOfURL: backgroundMusicURL error: NULL ];
[ self.backgroundMusic release ];&lt;/p&gt;

&lt;p&gt;self.backgroundMusic.volume = 0.5;
self.backgroundMusic.delegate = self;
[ self.backgroundMusic prepareToPlay ];
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;I get a memory leak on the prepareToPlay line. If I remove that line, then I don&#039;t get a memory leak flagged until some time later, when I call [ self.backgroundMusic play].&lt;/p&gt;

&lt;p&gt;I use AVAudioPlayer elsewhere to play non-MP3 using basically exactly the same code, with no memory leaks.&lt;/p&gt;

&lt;p&gt;Any ideas?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;

&lt;p&gt;Dingo&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the blog entry! Instruments/leaks was confusing me until I stumbled across this!</p>

<p>However&#8230; I am also experiencing a memory leak using AVAudioPlayer. Thanks to Instruments/Leaks and this blog, every other memory leak in my program has been tracked down and quashed, but not this one. With this bit of code:</p>

<p><pre><code>NSURL *backgroundMusicURL = [ NSURL fileURLWithPath: [ [ NSBundle mainBundle ] pathForResource: @"test" ofType: @"mp3" ] ];
self.backgroundMusic = [ [ AVAudioPlayer alloc ] initWithContentsOfURL: backgroundMusicURL error: NULL ];
[ self.backgroundMusic release ];</code></pre></p>

<p>self.backgroundMusic.volume = 0.5;
self.backgroundMusic.delegate = self;
[ self.backgroundMusic prepareToPlay ];
</p>

<p>I get a memory leak on the prepareToPlay line. If I remove that line, then I don&#8217;t get a memory leak flagged until some time later, when I call [ self.backgroundMusic play].</p>

<p>I use AVAudioPlayer elsewhere to play non-MP3 using basically exactly the same code, with no memory leaks.</p>

<p>Any ideas?</p>

<p>Thanks,</p>

<p>Dingo</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-1169</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Mon, 09 Mar 2009 14:13:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-1169</guid>
		<description>&lt;p&gt;Thank you for the information on Instruments.  There is so little out there...
Anyway.... Can anyone tell me why this leaks?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;(void)applicationDidFinishLaunching:(UIApplication *)application {&lt;/p&gt;

&lt;p&gt;[window makeKeyAndVisible];&lt;/p&gt;

&lt;p&gt;NSString *file = [[NSBundle mainBundle] 
                  pathForResource:@&quot;paris&quot; ofType:@&quot;mp3&quot;];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: file];&lt;/p&gt;

&lt;p&gt;AVAudioPlayer *newPlayer = 
[[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
[fileURL release];
self.player = newPlayer;
[newPlayer release];
[self.player play]; 
}&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;(void)dealloc {
[window release];
[super dealloc];
[player release];
}&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you for the information on Instruments.  There is so little out there&#8230;
Anyway&#8230;. Can anyone tell me why this leaks?</p>

<ul>
<li><p>(void)applicationDidFinishLaunching:(UIApplication *)application {</p>

<p>[window makeKeyAndVisible];</p>

<p>NSString *file = [[NSBundle mainBundle] 
                  pathForResource:@&#8221;paris&#8221; ofType:@&#8221;mp3&#8243;];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: file];</p>

<p>AVAudioPlayer *newPlayer = 
[[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
[fileURL release];
self.player = newPlayer;
[newPlayer release];
[self.player play]; 
}</p></li>
<li><p>(void)dealloc {
[window release];
[super dealloc];
[player release];
}</p></li>
</ul>]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-1160</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Tue, 24 Feb 2009 19:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-1160</guid>
		<description>&lt;p&gt;Thanks for writing this outstanding blog guys. I have just one quick inquiry for this particular thread. After releasing the NSMutableString, there is still a leaked object showing up in the application for NSPathStore2. Is this typical to leak? Is it something within the SDK that&#039;s having issues? (Running 2.2.1 here.)  Here&#039;s a screenshot: http://dl-client.getdropbox.com/u/57676/screenshots/leaks.png&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for writing this outstanding blog guys. I have just one quick inquiry for this particular thread. After releasing the NSMutableString, there is still a leaked object showing up in the application for NSPathStore2. Is this typical to leak? Is it something within the SDK that&#8217;s having issues? (Running 2.2.1 here.)  Here&#8217;s a screenshot: <a href="http://dl-client.getdropbox.com/u/57676/screenshots/leaks.png" rel="nofollow">http://dl-client.getdropbox.com/u/57676/screenshots/leaks.png</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: iPhone development snippets &#38; guides &#124; MikkoLehtinen.com</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-1121</link>
		<dc:creator>iPhone development snippets &#38; guides &#124; MikkoLehtinen.com</dc:creator>
		<pubDate>Tue, 16 Dec 2008 07:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-1121</guid>
		<description>&lt;p&gt;[...] Cocoa Tutorial: Fixing Memory Leaks With Instruments [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Cocoa Tutorial: Fixing Memory Leaks With Instruments [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Instruments - iPhone Dev SDK Forum</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-803</link>
		<dc:creator>Instruments - iPhone Dev SDK Forum</dc:creator>
		<pubDate>Tue, 16 Sep 2008 21:51:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-803</guid>
		<description>&lt;p&gt;[...] Cocoa Is My Girlfriend » Cocoa Tutorial: Fixing Memory Leaks With Instruments Instruments User Guide: Memory [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Cocoa Is My Girlfriend » Cocoa Tutorial: Fixing Memory Leaks With Instruments Instruments User Guide: Memory [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Cocoa Nut &#187; Finding Memory Leaks With The LLVM/Clang Static Analyzer</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-773</link>
		<dc:creator>Cocoa Nut &#187; Finding Memory Leaks With The LLVM/Clang Static Analyzer</dc:creator>
		<pubDate>Tue, 05 Aug 2008 02:03:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-773</guid>
		<description>&lt;p&gt;[...] you may be familiar with using tools like Instruments to find and fix memory leaks in your application, the Clang Static Analyzer takes a different approach to memory leak detection by compiling your [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] you may be familiar with using tools like Instruments to find and fix memory leaks in your application, the Clang Static Analyzer takes a different approach to memory leak detection by compiling your [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: blogsurdum :: flatulenzen im digitalen grundrauschen</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-599</link>
		<dc:creator>blogsurdum :: flatulenzen im digitalen grundrauschen</dc:creator>
		<pubDate>Sat, 17 May 2008 21:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-599</guid>
		<description>&lt;p&gt;[...] &#8594;cocoa tutorial [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] &#8594;cocoa tutorial [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Cromagnon</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-334</link>
		<dc:creator>Cromagnon</dc:creator>
		<pubDate>Fri, 04 Apr 2008 12:00:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-334</guid>
		<description>&lt;p&gt;I&#039;ve also seen it miss the initial leak from applicationDidFinishLaunching, but I can&#039;t reproduce it consistently.  Sometimes it shows up, and sometimes it doesn&#039;t.  The times when it doesn&#039;t may have occurred when I changed the default timeout to 1 second instead of 30, I&#039;m not sure... more experimentation will follow.&lt;/p&gt;

&lt;p&gt;Also, my colours are different too.  Cyan blocks just show hex numbers (a library without debug info available?), while blocks matching the app appear green.  Sorry, but being a heterosexual male, cyan/green is as much distinction as I can make between colours :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve also seen it miss the initial leak from applicationDidFinishLaunching, but I can&#8217;t reproduce it consistently.  Sometimes it shows up, and sometimes it doesn&#8217;t.  The times when it doesn&#8217;t may have occurred when I changed the default timeout to 1 second instead of 30, I&#8217;m not sure&#8230; more experimentation will follow.</p>

<p>Also, my colours are different too.  Cyan blocks just show hex numbers (a library without debug info available?), while blocks matching the app appear green.  Sorry, but being a heterosexual male, cyan/green is as much distinction as I can make between colours :)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: tarasis</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-327</link>
		<dc:creator>tarasis</dc:creator>
		<pubDate>Fri, 04 Apr 2008 08:38:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-327</guid>
		<description>&lt;p&gt;Okay,well I know what part of my problem was. Not noticing that the test app had a leak button. You didn&#039;t mention it in your article and given instruments starts on top I didn&#039;t see it.&lt;/p&gt;

&lt;p&gt;However the leak in applicationDidFinishLaunching is not recorded by Instruments.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Okay,well I know what part of my problem was. Not noticing that the test app had a leak button. You didn&#8217;t mention it in your article and given instruments starts on top I didn&#8217;t see it.</p>

<p>However the leak in applicationDidFinishLaunching is not recorded by Instruments.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: tarasis</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-326</link>
		<dc:creator>tarasis</dc:creator>
		<pubDate>Fri, 04 Apr 2008 08:27:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-326</guid>
		<description>&lt;p&gt;Hmm, I am not getting a leak either after letting the App run for 5 minutes and 41 seconds. This is with XCode 3.1 Beta 2 on Leopard.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hmm, I am not getting a leak either after letting the App run for 5 minutes and 41 seconds. This is with XCode 3.1 Beta 2 on Leopard.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Long</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-317</link>
		<dc:creator>Matt Long</dc:creator>
		<pubDate>Thu, 03 Apr 2008 20:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-317</guid>
		<description>&lt;p&gt;Josh,&lt;/p&gt;

&lt;p&gt;Does it detect them when you click the &quot;Leak&quot; button? Are you sure you&#039;re waiting for it to timeout or clicking the &quot;Check For Leaks Now&quot; button? It doesn&#039;t display leaks in real-time. It checks for new leaks every 30 seconds.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Josh,</p>

<p>Does it detect them when you click the &#8220;Leak&#8221; button? Are you sure you&#8217;re waiting for it to timeout or clicking the &#8220;Check For Leaks Now&#8221; button? It doesn&#8217;t display leaks in real-time. It checks for new leaks every 30 seconds.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-315</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Thu, 03 Apr 2008 20:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-315</guid>
		<description>&lt;p&gt;Thanks for the writeup..&lt;/p&gt;

&lt;p&gt;I was unable to get instruments to detect the leak in the applicationDidFinishLaunching method.  Am i doing something wrong or does it not pick it up.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the writeup..</p>

<p>I was unable to get instruments to detect the leak in the applicationDidFinishLaunching method.  Am i doing something wrong or does it not pick it up.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jason</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-310</link>
		<dc:creator>jason</dc:creator>
		<pubDate>Thu, 03 Apr 2008 17:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-310</guid>
		<description>&lt;p&gt;Will do once I&#039;m back at home with my Mac.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Will do once I&#8217;m back at home with my Mac.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Long</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-309</link>
		<dc:creator>Matt Long</dc:creator>
		<pubDate>Thu, 03 Apr 2008 16:24:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-309</guid>
		<description>&lt;p&gt;Jason,&lt;/p&gt;

&lt;p&gt;Send me a screenshot at matt at cimgf dot com so I can take a look.&lt;/p&gt;

&lt;p&gt;-Matt&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Jason,</p>

<p>Send me a screenshot at matt at cimgf dot com so I can take a look.</p>

<p>-Matt</p>]]></content:encoded>
	</item>
	<item>
		<title>By: lunohodov</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-290</link>
		<dc:creator>lunohodov</dc:creator>
		<pubDate>Thu, 03 Apr 2008 07:15:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-290</guid>
		<description>&lt;p&gt;Jason, the colors are used to make each library visually distinct. Ctrl+Click and choose Color By Library.&lt;/p&gt;

&lt;p&gt;Regards&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Jason, the colors are used to make each library visually distinct. Ctrl+Click and choose Color By Library.</p>

<p>Regards</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jason</title>
		<link>http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/comment-page-1/#comment-287</link>
		<dc:creator>jason</dc:creator>
		<pubDate>Thu, 03 Apr 2008 04:15:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.cimgf.com/2008/04/02/cocoa-tutorial-fixing-memory-leaks-with-instruments/#comment-287</guid>
		<description>&lt;p&gt;No matter how many times I run your sample app through Instruments, I never get a double-clickable detail in the color #CCFFFF. The only details I see in that color are blocks with a memory address on them and when I click, they do nothing. The only details I can click on are a mauve color of some sort. I&#039;m following your details to the letter. Any idea what might be wrong? And also, do you guys know of a reference to what each color represents?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>No matter how many times I run your sample app through Instruments, I never get a double-clickable detail in the color #CCFFFF. The only details I see in that color are blocks with a memory address on them and when I click, they do nothing. The only details I can click on are a mauve color of some sort. I&#8217;m following your details to the letter. Any idea what might be wrong? And also, do you guys know of a reference to what each color represents?</p>]]></content:encoded>
	</item>
</channel>
</rss>
