<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 25 May 2013 20:41:00 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Collecting Garbage: Cleaning Up]]></title>
      <guid>http://www.phpdeveloper.org/news/15086</guid>
      <link>http://www.phpdeveloper.org/news/15086</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has continued his series on garbage collection in the PHP internals with <a href="http://derickrethans.nl/collecting-garbage-cleaning-up.html">this second post</a> of the series with a special look at circular references. You can find the first part <a href="http://phpdeveloper.org/news/15049">here</a>.
</p>
<blockquote>
In this second part of the three part column on the new garbage collecting mechanism in PHP 5.3, we'll dive into a solution to the problem with circular references. If we look quickly back, we found that by using code like the [first example], an in-request memory leak is created.
</blockquote>
<p>
He goes on to briefly describe the synchronous algorithm (including a few more helpful graphs to show the flow) and how that has worked its way into the PHP garbage collection methods. He also points out that this collection can be turned off and on via the <a href="http://php.net/gc_enable">gc_enable</a> and <a href="http://php.net/gc_disable">gc_disable</a> functions. Keep an eye out for the next part of the series where he gets into more detail on how this is all integrated into PHP.
</p>]]></description>
      <pubDate>Tue, 07 Sep 2010 09:56:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Alex Netkachov's Blog: Optimize PHP memory usage: eliminate circular references]]></title>
      <guid>http://www.phpdeveloper.org/news/8676</guid>
      <link>http://www.phpdeveloper.org/news/8676</link>
      <description><![CDATA[<p>
On his blog today, <i>Alex Netkachov</i> has <a href="http://www.alexatnet.com/node/73">posted a suggestion</a> of how to combat a common issue facing PHP scripts - their memory usage.
</p>
<blockquote>
PHP has a build-in garbage collector so you do not need to track the links on the objects, allocate memory for objects and delete them when they are not longer necessary. Things seem so perfect that developers do not even know that their scripts allocate a lot of memory until their server stops processing requests because of the out of memory error.
</blockquote>
<p>
<a href="http://www.alexatnet.com/node/73">His example</a> is the processing of a parent/child relationship tree. If not managed correctly, the variables being used could get out of hand quite quickly. <i>Alex</i> recommends the use of a "destructor" at the end of each iteration to help destroy variables and values no longer needed.
</p>]]></description>
      <pubDate>Tue, 18 Sep 2007 17:17:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Circular References]]></title>
      <guid>http://www.phpdeveloper.org/news/8124</guid>
      <link>http://www.phpdeveloper.org/news/8124</link>
      <description><![CDATA[<p>
In a new post, <i>Derick Rethans</i> <a href="http://derickrethans.nl/circular_references.php">talks about</a> circular references (a reference of a memory structure back to itself) and how they relate to PHP.
</p>
<blockquote>
Circular-references has been a long outstanding issue with PHP. They are caused by the fact that PHP uses a reference counted memory allocation mechanism for its internal variables. This causes problems for longer running scripts (such as an <a href="http://blog.milkfarmsoft.com/?p=51">Application Server</a> or the <a href="http://ez.no/ezcomponents">eZ Components</a> test-suite) as the memory is not freed until the end of the request. But not everybody is aware on what exactly the problem is, so here is a small introduction to circular references in PHP.
</blockquote>
<p>
He starts by explaining what's so bad about circular references - issues not only with referencing the variable but also with freeing up the resources associated with it. He does <a href="http://derickrethans.nl/circular_references.php">suggest some solutions</a> to the issue including garbage collection and cyclic tracing.
</p>]]></description>
      <pubDate>Tue, 26 Jun 2007 09:21:00 -0500</pubDate>
    </item>
  </channel>
</rss>
