<?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: Where&#8217;d That Memory Go?</title>
	<atom:link href="http://gamesfromwithin.com/whered-that-memory-go/feed" rel="self" type="application/rss+xml" />
	<link>http://gamesfromwithin.com/whered-that-memory-go</link>
	<description>Living the indie life</description>
	<lastBuildDate>Thu, 09 Feb 2012 12:36:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Noel</title>
		<link>http://gamesfromwithin.com/whered-that-memory-go/comment-page-1#comment-1950</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Sun, 17 May 2009 18:53:23 +0000</pubDate>
		<guid isPermaLink="false">http://gamesfromwithin.com/?p=456#comment-1950</guid>
		<description>Thanks, Colin! I didn&#039;t know about mmap, but that&#039;s exactly what I was looking for. It works perfectly on the iPhone and allows me to allocate pages directly without going through the indirections of malloc. Perfect!</description>
		<content:encoded><![CDATA[<p>Thanks, Colin! I didn&#8217;t know about mmap, but that&#8217;s exactly what I was looking for. It works perfectly on the iPhone and allows me to allocate pages directly without going through the indirections of malloc. Perfect!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Barrett</title>
		<link>http://gamesfromwithin.com/whered-that-memory-go/comment-page-1#comment-1949</link>
		<dc:creator>Colin Barrett</dc:creator>
		<pubDate>Sun, 17 May 2009 17:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://gamesfromwithin.com/?p=456#comment-1949</guid>
		<description>Excellent series of articles Noel. With regard to the &#039;lower-level way to allocate memory&#039; - have you tried an anonymous mmap? Something like this:

void *mem = mmap(0, mem_bytes, PROT_READ&#124;PROT_WRITE, MAP_PRIVATE&#124;MAP_ANON, -1, 0);

You&#039;ll need to include sys/mman.h. This works on OSX proper - I haven&#039;t tried it on the iPhone.</description>
		<content:encoded><![CDATA[<p>Excellent series of articles Noel. With regard to the &#8216;lower-level way to allocate memory&#8217; &#8211; have you tried an anonymous mmap? Something like this:</p>
<p>void *mem = mmap(0, mem_bytes, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);</p>
<p>You&#8217;ll need to include sys/mman.h. This works on OSX proper &#8211; I haven&#8217;t tried it on the iPhone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel</title>
		<link>http://gamesfromwithin.com/whered-that-memory-go/comment-page-1#comment-1946</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Sat, 16 May 2009 22:35:02 +0000</pubDate>
		<guid isPermaLink="false">http://gamesfromwithin.com/?p=456#comment-1946</guid>
		<description>Nathan, Good guess, but no cigar! I would have been very surprised if somehow the virtual memory system knew that you had filled a full page with zeroes and added it to a different pool. I think that zero_fill_count must be for pages that are flagged in some special ways.

I haven&#039;t able to find good documentation on this, but zero_fill_count doesn&#039;t even appear to be a count of physical pages. When I run it on the iPhone it reports to have 300,000+ zero_fill_count. So maybe that&#039;s the number of pages to fill in the gaps between different real allocations? In any case, it seems it&#039;s not the answer to this riddle.

Just to double-triple check, I changed bzero to memset(mem, 0xCD, size) and I still have the same problem of disappearing vm pages.</description>
		<content:encoded><![CDATA[<p>Nathan, Good guess, but no cigar! I would have been very surprised if somehow the virtual memory system knew that you had filled a full page with zeroes and added it to a different pool. I think that zero_fill_count must be for pages that are flagged in some special ways.</p>
<p>I haven&#8217;t able to find good documentation on this, but zero_fill_count doesn&#8217;t even appear to be a count of physical pages. When I run it on the iPhone it reports to have 300,000+ zero_fill_count. So maybe that&#8217;s the number of pages to fill in the gaps between different real allocations? In any case, it seems it&#8217;s not the answer to this riddle.</p>
<p>Just to double-triple check, I changed bzero to memset(mem, 0xCD, size) and I still have the same problem of disappearing vm pages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan</title>
		<link>http://gamesfromwithin.com/whered-that-memory-go/comment-page-1#comment-1944</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Sat, 16 May 2009 16:07:22 +0000</pubDate>
		<guid isPermaLink="false">http://gamesfromwithin.com/?p=456#comment-1944</guid>
		<description>It&#039;s just a guess, but it looks like you&#039;re not taking into account the zero_fill_count from the VM statistics struct.  Considering that you&#039;re using bzero() (which I&#039;m guessing writes zeros to memory) to touch the memory you allocate, it seems possible that the OS might mark the pages as being zero filled rather than putting them in some other category.

Let me know if I&#039;m missing something.  I know next to nothing about iPhone and OSX development, so it&#039;s quite possible.</description>
		<content:encoded><![CDATA[<p>It&#8217;s just a guess, but it looks like you&#8217;re not taking into account the zero_fill_count from the VM statistics struct.  Considering that you&#8217;re using bzero() (which I&#8217;m guessing writes zeros to memory) to touch the memory you allocate, it seems possible that the OS might mark the pages as being zero filled rather than putting them in some other category.</p>
<p>Let me know if I&#8217;m missing something.  I know next to nothing about iPhone and OSX development, so it&#8217;s quite possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Antair Games &#187; Blog Archive &#187; Weekly Update</title>
		<link>http://gamesfromwithin.com/whered-that-memory-go/comment-page-1#comment-1942</link>
		<dc:creator>Antair Games &#187; Blog Archive &#187; Weekly Update</dc:creator>
		<pubDate>Sat, 16 May 2009 08:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://gamesfromwithin.com/?p=456#comment-1942</guid>
		<description>[...] Llopis is doing some interesting experiments to figure out the memory system on the iPhone, well worth checking [...]</description>
		<content:encoded><![CDATA[<p>[...] Llopis is doing some interesting experiments to figure out the memory system on the iPhone, well worth checking [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.289 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-09 05:31:52 -->

