<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Create Blog &#187; memory leaks</title>
	<atom:link href="http://create.tpsitulsa.com/blog/tag/memory-leaks/feed/" rel="self" type="application/rss+xml" />
	<link>http://create.tpsitulsa.com/blog</link>
	<description>the create framework blog</description>
	<lastBuildDate>Sat, 30 Jan 2010 20:08:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Making SproutCore Objects Show in Chromium&#8217;s Heap Profiler</title>
		<link>http://create.tpsitulsa.com/blog/2009/12/15/sc-objects-heap-profiler/</link>
		<comments>http://create.tpsitulsa.com/blog/2009/12/15/sc-objects-heap-profiler/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 16:38:08 +0000</pubDate>
		<dc:creator>Alex Iskander</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[SproutCore]]></category>
		<category><![CDATA[V8]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[chromium]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[memory leaks]]></category>
		<category><![CDATA[profiler]]></category>

		<guid isPermaLink="false">http://create.tpsitulsa.com/blog/?p=277</guid>
		<description><![CDATA[It&#8217;s a hack. If Chromium+v8 would just support displayName, it could all be nice and clean and part of SproutCore (please go tell the Chromium folks how helpful this would be). As it is, this hack could have some SEVERE side-effects, but chances are, if you are trying to debug a memory leak, you won&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a hack. If Chromium+v8 would <a href="http://code.google.com/p/chromium/issues/detail?id=17356&#038;q=area%3DDevTools&#038;colspec=ID%20Stars%20Pri%20Area%20Type%20Status%20Summary%20Modified%20Owner%20Mstone%20OS">just support displayName</a>, it could all be nice and clean and part of SproutCore (please go tell the Chromium folks how helpful this would be).</p>

<p>As it is, this hack could have some <em>SEVERE</em> side-effects, but chances are, if you are trying to debug a memory leak, you won&#8217;t care about these side-effects because everything else will be driving you MAD (and, you&#8217;ll probably be able to find these side-effects much more easily than the leak itself).</p>

<p>It is very simple; here is how to do it for ListItemView:</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">SC.<span style="color: #660066;">mixin</span><span style="color: #009900;">&#40;</span>SC.<span style="color: #660066;">ListItemView</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> create<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">new</span> SC._ListItemView<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
SC._ListItemView <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>base_type<span style="color: #339933;">,</span> args<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  base_type.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> args<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// for extra safety (should get around most potential side-effects):</span>
SC.<span style="color: #660066;">mixin</span><span style="color: #009900;">&#40;</span>SC._ListItemView<span style="color: #339933;">,</span> SC.<span style="color: #660066;">ListItemView</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
SC._ListItemView.<span style="color: #660066;">prototype</span> <span style="color: #339933;">=</span> SC.<span style="color: #660066;">ListItemView</span>.<span style="color: #660066;">prototype</span><span style="color: #339933;">;</span></pre></div></div>


<p>Now, ListItemViews will show up as SC._ListItemView in the heap profile. Hooray!</p>

<p>P.S. This revealed for me that the objects leaking were not SC.ListItemViews. I still have no idea what is leaking, and am giving up for now—but at least I&#8217;ll have better tools when I come back to it. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://create.tpsitulsa.com/blog/2009/12/15/sc-objects-heap-profiler/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
