<?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: When garbage collection does more than you want</title>
	<atom:link href="http://annafilina.com/blog/garbage-collection-does-too-much/feed/" rel="self" type="application/rss+xml" />
	<link>http://annafilina.com/blog/garbage-collection-does-too-much/</link>
	<description>I fix stuff</description>
	<lastBuildDate>Thu, 19 Apr 2012 12:13:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel</title>
		<link>http://annafilina.com/blog/garbage-collection-does-too-much/comment-page-1/#comment-1052</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 02 Nov 2009 19:26:44 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=325#comment-1052</guid>
		<description>When garbage collection does LESS than you want:
I was creating a new object every second and deleting another one so I only had 8 at any one time..
Flash&#039;s memory went up and up and up till 200MB and the fps went down to 0!

Instead I stored an array of ones I had pre-made and GC comes along when I destroy everything! Bad hack but it&#039;s the only way round it.</description>
		<content:encoded><![CDATA[<p>When garbage collection does LESS than you want:<br />
I was creating a new object every second and deleting another one so I only had 8 at any one time..<br />
Flash&#8217;s memory went up and up and up till 200MB and the fps went down to 0!</p>
<p>Instead I stored an array of ones I had pre-made and GC comes along when I destroy everything! Bad hack but it&#8217;s the only way round it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor</title>
		<link>http://annafilina.com/blog/garbage-collection-does-too-much/comment-page-1/#comment-696</link>
		<dc:creator>Victor</dc:creator>
		<pubDate>Thu, 24 Sep 2009 09:40:56 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=325#comment-696</guid>
		<description>I disagree it&#039;s a good habit to use weak listeners references.

I thought that for a while, but I have come to the conclusion that it is much better to get used to remove the listeners when it&#039;s appropriate.

If you use weak listeners, you will continue to receive notifications sometimes, and sometimes not, depending on the whim of the garbage collector. Bad idea. It&#039;s better to always receive the event, so that it reminds you of removing the listener. 

I think that I thought that because I didn&#039;t realized that when A points to B and B points to A, and no one of both points to any other external object, then both will get collected.</description>
		<content:encoded><![CDATA[<p>I disagree it&#8217;s a good habit to use weak listeners references.</p>
<p>I thought that for a while, but I have come to the conclusion that it is much better to get used to remove the listeners when it&#8217;s appropriate.</p>
<p>If you use weak listeners, you will continue to receive notifications sometimes, and sometimes not, depending on the whim of the garbage collector. Bad idea. It&#8217;s better to always receive the event, so that it reminds you of removing the listener. </p>
<p>I think that I thought that because I didn&#8217;t realized that when A points to B and B points to A, and no one of both points to any other external object, then both will get collected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anna</title>
		<link>http://annafilina.com/blog/garbage-collection-does-too-much/comment-page-1/#comment-583</link>
		<dc:creator>Anna</dc:creator>
		<pubDate>Mon, 07 Sep 2009 22:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=325#comment-583</guid>
		<description>Even if you keep the declaration outside of the loop, the garbage collector might pick up everything except the last loader. Every iteration, you remove the reference to the previous loader, thus enabling it to be removed from memory. Reusing the loader variable has proven unreliable in my projects.</description>
		<content:encoded><![CDATA[<p>Even if you keep the declaration outside of the loop, the garbage collector might pick up everything except the last loader. Every iteration, you remove the reference to the previous loader, thus enabling it to be removed from memory. Reusing the loader variable has proven unreliable in my projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliot Rock</title>
		<link>http://annafilina.com/blog/garbage-collection-does-too-much/comment-page-1/#comment-577</link>
		<dc:creator>Elliot Rock</dc:creator>
		<pubDate>Sat, 05 Sep 2009 10:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://annafilina.com/blog/?p=325#comment-577</guid>
		<description>I am not sure of how you instantised this loaders with a loop but there are a couple of options which may work around these issues:

keep the declaration of that loader outside og the loop:

var len: int = 5; // or whatever your length  is
var newLoader : loader;
for(var i : int , i&lt; len, i++){
 newLoader = new Loader();
//
}

Or use a simple loader with the complete event as a protected function and use inheritance to extend this simple loader, use polymorphism and override the function for the complete in this new class. You simply tick through each url and place the contents into an array. You are reusing the same loader as well.

I should show an example but do you get what I am saying?

Elliot</description>
		<content:encoded><![CDATA[<p>I am not sure of how you instantised this loaders with a loop but there are a couple of options which may work around these issues:</p>
<p>keep the declaration of that loader outside og the loop:</p>
<p>var len: int = 5; // or whatever your length  is<br />
var newLoader : loader;<br />
for(var i : int , i&lt; len, i++){<br />
 newLoader = new Loader();<br />
//<br />
}</p>
<p>Or use a simple loader with the complete event as a protected function and use inheritance to extend this simple loader, use polymorphism and override the function for the complete in this new class. You simply tick through each url and place the contents into an array. You are reusing the same loader as well.</p>
<p>I should show an example but do you get what I am saying?</p>
<p>Elliot</p>
]]></content:encoded>
	</item>
</channel>
</rss>

