<?xml version="1.0" ?>
<rss version="2.0">
	<channel>
		<title>Keith's Weblog: Comments on &quot;Flickr and PHP&quot;</title>
		<description>Keith's Weblog: Comments on &quot;Flickr and PHP&quot;, posted on October 25, 2004</description>
		<link>http://keithdevens.com/weblog/archive/2004/Oct/25/Flickr-and-PHP</link>

		<category>Programming</category>
		<language>en-us</language>
		<image>
			<link>http://keithdevens.com/weblog</link>
			<title>Keith Devens .com</title>
			<url>http://keithdevens.com/images/kbd.gif</url>
		</image>

		<item>
			<title>by cal</title>
			<link>http://keithdevens.com/weblog/archive/2004/Oct/25/Flickr-and-PHP#comment6109</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5877#comment6109</guid>
			<pubDate>Wed, 27 Oct 2004 22:21:45 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;that should have read: &lt;/p&gt;

&lt;blockquote class=&quot;st-markup&quot;&gt;&lt;p&gt;PHP 4 doesn’t have good a XML parser &lt;em&gt;&lt;strong&gt;built in&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;

</description>
		</item>
		<item>
			<title>by Keith</title>
			<link>http://keithdevens.com/weblog/archive/2004/Oct/25/Flickr-and-PHP#comment6110</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5877#comment6110</guid>
			<pubDate>Wed, 27 Oct 2004 22:56:54 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;Ha, it's all good. I should have put a smiley face next to that &amp;quot;hey&amp;quot; to make it clear I wasn't actually offended.&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by calin</title>
			<link>http://keithdevens.com/weblog/archive/2004/Oct/25/Flickr-and-PHP#comment6119</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5877#comment6119</guid>
			<pubDate>Thu, 28 Oct 2004 09:53:15 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;read more about this myth &amp;quot;PHP isn’t so great at being a daemon... Leaks memory like a sieve&amp;quot;:&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;&lt;a href=&quot;http://www.php9.com/index.php/archives/2004/10/28/php-leaks-memory-myths/&quot;&gt;http://www.php9.com/index.php/archives/2004/10/28/php-leaks-memory-myths/&lt;/a&gt;&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by Gaetano Giunta</title>
			<link>http://keithdevens.com/weblog/archive/2004/Oct/25/Flickr-and-PHP#comment6129</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5877#comment6129</guid>
			<pubDate>Thu, 28 Oct 2004 23:47:55 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;I'll be darned! I've had lottsa PHP scripts running as daemons for years, and nobody ever told me that. Guess I'll have to shut them off now!!!&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;Facts:&lt;br /&gt;
- PHP engine does NOT leak memory on its own&lt;br /&gt;
- programmers are much more likely to have leaks in their own code&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;a very simple example: an array that is added a value every loop iteration, say $a[] = newelement();, and is never reset.&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;Just as with any other daemon, be careful in what you code. Close and reopen database connections whenever a SQL error is triggered (nr.1 tip), free resources as soon as you can and so on...&lt;/p&gt;

</description>
		</item>
		<item>
			<title>by Keith</title>
			<link>http://keithdevens.com/weblog/archive/2004/Oct/25/Flickr-and-PHP#comment6136</link>
			<guid isPermaLink="false">http://keithdevens.com/weblog/5877#comment6136</guid>
			<pubDate>Fri, 29 Oct 2004 03:46:05 +0000</pubDate>
			<description>&lt;p class=&quot;st-markup&quot;&gt;Well, it's good to hear some counterexamples about running PHP as a daemon. I haven't done it myself, so I don't have direct experience with it. I have to assume Cal did tests with it before he coded his daemon in Java and that he's speaking from experience.&lt;/p&gt;

&lt;p class=&quot;st-markup&quot;&gt;Ah, here's a comment he left on the above post at php9.com:&lt;/p&gt;

&lt;blockquote class=&quot;st-markup&quot;&gt;&lt;p&gt;that comment, “like a sieve&amp;quot;, is from a presentation i made about how we were using php for an app which is currently doing the rounds.&lt;br /&gt;
&lt;br /&gt;
our experiments with php showed that it &lt;em&gt;wasn’t&lt;/em&gt; freeing memory correctly when large variables went out of scope. the tests were basically loading big files into memory, processing them with objects and then freeing all the data - the longer the process ran, the more memory it consumed. it’s possible that it’s been fixed since, but at the time this was one of the reasons why we didn’t write any daemons in php.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p class=&quot;st-markup&quot;&gt;Another commenter on the page claims that even PHP 5 still &amp;quot;leaks quite a bit&amp;quot;. So, it seems it's still something to be wary of, at least. I'll keep in mind your tip about closing and reopening db connections upon errors, thanks.&lt;/p&gt;

</description>
		</item>
	</channel>
</rss>
