<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Myth: Without /3GB a single program can't allocate more than 2GB of virtual memory</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx</link><description>Virtual memory is not virtual address space (part 2).</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>“Out Of Memory” Does Not Refer to Physical Memory</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#9726015</link><pubDate>Thu, 11 Jun 2009 10:05:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9726015</guid><dc:creator>Fabulous Adventures In Coding</dc:creator><description>&lt;p&gt;I started programming on x86 machines during a period of large and rapid change in the memory management&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9726015" width="1" height="1"&gt;</description></item><item><title>re: Why is the page size on ia64 8K?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#226843</link><pubDate>Wed, 08 Sep 2004 18:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:226843</guid><dc:creator>The Old New Thing</dc:creator><description>&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=226843" width="1" height="1"&gt;</description></item><item><title>re: Myth: Without /3GB a single program can't allocate more than 2GB of virtual memory</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#218539</link><pubDate>Sun, 22 Aug 2004 15:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:218539</guid><dc:creator>Raymond Chen</dc:creator><description>&amp;quot;Allocate means it is available in my address space.&amp;quot;&lt;br&gt;&lt;br&gt;No! You missed the whole point of this entry.&lt;br&gt;&lt;br&gt;&amp;quot;Mapped&amp;quot; means it is available in your address space.  &amp;quot;Allocate&amp;quot; means that the memory is committed to you.&lt;br&gt;&lt;br&gt;You can &amp;quot;actually&amp;quot; use the memory - my ReadByte function shows how.  It's not convenient, but it is nevertheless actual.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=218539" width="1" height="1"&gt;</description></item><item><title>re: Myth: Without /3GB a single program can't allocate more than 2GB of virtual memory</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#218535</link><pubDate>Sun, 22 Aug 2004 14:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:218535</guid><dc:creator>Jack Tripper</dc:creator><description>Something that you are failing to deal with in this series of articles, that makes all their information lost: &lt;br&gt;&lt;br&gt;explain the different between allocated memory and mapped memory.&lt;br&gt;&lt;br&gt;If i want to allocate 2.5GB of memory, and i don't have the /3GB switch, then i can't use 2.5GB of memory.&lt;br&gt;&lt;br&gt;You try to talk about tricks of mapping parts of files and whatnot. But i want to map a 2.5GB file, i want to access it all; and i can't. And that is because without the /3GB switch i cannot allocate more than 2GB.&lt;br&gt;&lt;br&gt;Dwell on the difference between *technically* somewhere there is more than 2GB of memory set aside for stuff, and *actually* not being able to use more than 2GB.&lt;br&gt;&lt;br&gt;Allocate means it is available in my address space.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=218535" width="1" height="1"&gt;</description></item><item><title>The story of the 3GB server switch</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#217838</link><pubDate>Fri, 20 Aug 2004 20:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:217838</guid><dc:creator>Savage Nomads</dc:creator><description> &amp;amp;nbsp; As Evan&amp;amp;nbsp;already mentioned on his blog, Raymond Chen has a great series on /3GB switch on his blog. What is really cool is that Raymond takes on some myths about the /3GB switch and&amp;amp;nbsp; the fact that he...&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=217838" width="1" height="1"&gt;</description></item><item><title>/3GB Switch</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#212666</link><pubDate>Wed, 11 Aug 2004 16:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:212666</guid><dc:creator>Welcome to Flaphead.com @ Home</dc:creator><description>&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=212666" width="1" height="1"&gt;</description></item><item><title>re: Myth: Without /3GB a single program can't allocate more than 2GB of virtual memory</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#212733</link><pubDate>Wed, 11 Aug 2004 15:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:212733</guid><dc:creator>Simon Cooke [exMSFT]</dc:creator><description>Andreas wrote:&lt;br&gt;&amp;gt; Yeah, I got that, but if you do this setup &lt;br&gt;&amp;gt; at a time when there's only one thread (e.g. &lt;br&gt;&amp;gt; at startup) it should be safe, right?&lt;br&gt;&lt;br&gt;Because of load-time DLL injection, and depending on the version of the OS and which libraries it needs, there's no real way of 100% ensuring that.&lt;br&gt;&lt;br&gt;Paul Walker wrote:&lt;br&gt;&amp;gt; Simon - I'm not sure that mapping the buffer &lt;br&gt;&amp;gt; twice helps speed that much. Okay, it means &lt;br&gt;&amp;gt; that you don't have to access byte-by-byte &lt;br&gt;&amp;gt; the whole time, but in practice you wouldn't &lt;br&gt;&amp;gt; do that anyway, and you still have to do the &lt;br&gt;&amp;gt; comparison to buffer-size in order to wrap &lt;br&gt;&amp;gt; once you have gone off the end. &lt;br&gt;&lt;br&gt;You only have to do the comparison to buffer size when you add or remove data from the buffer - which is infrequently. And even then, you only need to adjust your head pointer when you remove data.&lt;br&gt;&lt;br&gt;Compare it with the other ring buffer implementations out there on CodeProject et al. Either you can make things really complicated, and deal with the buffer in two halves, or you access it a byte at a time.&lt;br&gt;&lt;br&gt;Also, another advantage of this is that if you use it with overlapped IO, you can set things up such that you can be feeding data into one end of the buffer, consuming it from the other, and whenever you try to do a Send or Write, you can always send the whole contents of the buffer in one go. If you're using zero-copy writes/sends, this becomes quite important (eg. high-perf networking).&lt;br&gt;&lt;br&gt;&amp;gt; Regarding the interleaving of memory - with &lt;br&gt;&amp;gt; all the stuff Windows lets you do to its &lt;br&gt;&amp;gt; internals, isn't there a call to temporarily &lt;br&gt;&amp;gt; lock the scheduler? &lt;br&gt;&lt;br&gt;Nope. At least, not in user-mode code. That'd kind of defeat the point of the pre-emptiveness of the scheduler. You can temporarily boost yourself to realtime priority, but that (again) isn't 100% foolproof - you could have other realtime threads to compete with. Another option is to suspend all other threads in your process, and then resume them, but you risk setting up race conditions and losing state that way&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=212733" width="1" height="1"&gt;</description></item><item><title>re: Myth: Without /3GB a single program can't allocate more than 2GB of virtual memory</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#212707</link><pubDate>Wed, 11 Aug 2004 14:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:212707</guid><dc:creator>Raymond Chen</dc:creator><description>Alas that's not how the i386 works; more on this is scheduled for a future entry.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=212707" width="1" height="1"&gt;</description></item><item><title>re: Myth: Without /3GB a single program can't allocate more than 2GB of virtual memory</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#212690</link><pubDate>Wed, 11 Aug 2004 14:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:212690</guid><dc:creator>dave stokes</dc:creator><description>Raymond -&lt;br&gt;&lt;br&gt;&amp;quot;Please elaborate on what you mean by &amp;quot;address it directly&amp;quot;. You can do that today. It's called a 32-bit pointer.&amp;quot;&lt;br&gt;&lt;br&gt;Yeah, I'm just a dumb guy. But I'd have thought my meaning was actually pretty clear from everything else I wrote, I'm talking about addressing the 4GB you've mapped to what you've chosen to call &amp;quot;virtual memory&amp;quot;. You can't address that directly, only as you say yourself by mapping parts of it to a window in your 2GB address space. &lt;br&gt;&lt;br&gt;With the hardware mechanisms I've mentioned in a previous thread, data in a seperate address space can have a full range of say 4GB which can be directly addressed by suitable hardware registers, for what it's worth.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=212690" width="1" height="1"&gt;</description></item><item><title>re: Myth: Without /3GB a single program can't allocate more than 2GB of virtual memory</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2004/08/10/211890.aspx#212671</link><pubDate>Wed, 11 Aug 2004 13:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:212671</guid><dc:creator>Paul Walker</dc:creator><description>Regarding all of this... Linux makes distinctions between various different types of address, such as:&lt;br&gt;&lt;br&gt;* user virtual addresses (seen by user-space code)&lt;br&gt;* physical addresses (used between CPU and memory)&lt;br&gt;* bus addresses (used between peripherals and mem)&lt;br&gt;* kernel logical addresses&lt;br&gt;* kernel virtual addresses&lt;br&gt;&lt;br&gt;I'd imagine Windows makes at least the same distinctions.&lt;br&gt;&lt;br&gt;For what it's worth, I've never heard physical memory used to refer to anything except RAM chips. Certainly not swap.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=212671" width="1" height="1"&gt;</description></item></channel></rss>