<?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>PHP Software Developing &#187; memory</title>
	<atom:link href="http://www.phpdeveloping.co.za/tag/memory/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpdeveloping.co.za</link>
	<description>for the love of PHP Development</description>
	<lastBuildDate>Tue, 29 Sep 2009 15:38:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How much memory your script is using</title>
		<link>http://www.phpdeveloping.co.za/memory/how-much-memory-your-script-is-using.html</link>
		<comments>http://www.phpdeveloping.co.za/memory/how-much-memory-your-script-is-using.html#comments</comments>
		<pubDate>Mon, 27 Jul 2009 11:14:12 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[memory]]></category>
		<category><![CDATA[memory_get_usage]]></category>

		<guid isPermaLink="false">http://www.phpdeveloping.co.za/?p=87</guid>
		<description><![CDATA[An invaluable function is memory_get_usage.  This function returns the amount of memory your script is being used.
As an example check how much memory giving a value to a variable will use:

  //start memory
  $mem_start = memory_get_usage&#40;&#41;;
&#160;
  $s = &#34;This is a test variable.&#34;;  
&#160;
  //end memory
  $mem_end = [...]]]></description>
			<content:encoded><![CDATA[<p>An invaluable function is <a href="http://us2.php.net/manual/en/function.memory-get-usage.php">memory_get_usage</a>.  This function returns the amount of memory your script is being used.</p>
<p>As an example check how much memory giving a value to a variable will use:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #666666; font-style: italic;">//start memory</span>
  <span style="color: #000088;">$mem_start</span> <span style="color: #339933;">=</span> <span style="color: #990000;">memory_get_usage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$s</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;This is a test variable.&quot;</span><span style="color: #339933;">;</span>  
&nbsp;
  <span style="color: #666666; font-style: italic;">//end memory</span>
  <span style="color: #000088;">$mem_end</span> <span style="color: #339933;">=</span> <span style="color: #990000;">memory_get_usage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//total used</span>
  <span style="color: #000088;">$used</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$mem_end</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$mem_used</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$used</span><span style="color: #339933;">;</span></pre></div></div>

<p>You can use this to check if there are any potential memory problems with your script.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpdeveloping.co.za/memory/how-much-memory-your-script-is-using.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
