Myth: Without /3GB the total amount of memory that can be allocated across all programs is 2GB

Date:August 9, 2004 / year-entry #302
Tags:other
Orig Link:https://blogs.msdn.microsoft.com/oldnewthing/20040809-00/?p=38213
Comments:    10
Summary:Virtual memory is not virtual address space (part 1). I don't know where this myth comes from; it's a non sequitur. Virtual address space describes how addresses are resolved, but since each process has its own virtual address space, the amount consumed by one program has no effect on that consumed by another program. Say...

Virtual memory is not virtual address space (part 1).

I don't know where this myth comes from; it's a non sequitur.

Virtual address space describes how addresses are resolved, but since each process has its own virtual address space, the amount consumed by one program has no effect on that consumed by another program.

Say you have a program that allocates 1GB of memory. Run three copies of it. Now you have a total of 3GB of allocated memory. And none of the programs came even close to exhausting its 2GB virtual address space allotment.

Tomorrow, the debunking of a variation on this myth.


Comments (10)
  1. Skywing says:

    As a side note, with a bit of work, you can use lots more than 2GB of memory per process without using /3GB: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/address_windowing_extensions.asp

    This comes without the cost of throttling the kernel address space.

  2. Mike Dimmick says:

    …but with the cost of being a royal PIA. It’s basically doing your memory management manually, with the side effect of also removing some physical memory permanently from the OS’s control – it can’t swap memory reserved for AWE out, allocate it to another process or use it for the OS’s own purposes.

    Also, only users (security principals) with the ‘Lock Pages In Memory’ privilege (SE_LOCK_MEMORY_NAME) can call the AWE APIs. By default no principals have this right. SQL Server 2000’s setup program enables this right for the SQL Server service account. By contrast, the larger address space enabled by /3GB is available to all users.

    SQL 2005 I think continues to support AWE on 32-bit x86 processors. The APIs are present but basically useless on 64-bit systems.

  3. winden says:

    Does AWE work like late 80s memory managers with all that segment dance?

  4. One such confused site is LockerGnome. Just goes to show that, as usual, you can only trust people that actually work in the field; not those that merely write about it :-)

    (For a recently posted version of this myth, see http://channels.lockergnome.com/it/archives/20040806_when_is_4gb_of_ram_not_really_4gb_of_ram.phtml )

  5. Fei Liu says:

    One should read "The Thing King" story and make sure it’s understood before commenting on modern operating system memory management.

  6. David Candy says:

    I don’t see anything wrong with the lockergnome article except 1 skoppy use of a term (RAM) that everybody misuses anyway to mean any memory. I had to read it three times to find that anyway.

  7. Rohit J says:

    What about Shared Memory, Is some share of address Space reserved for it?

  8. Raymond Chen says:

    Shared memory is not shared address space. A little experimentation with MapViewOfFile will demonstrate.

  9. Luc Cluitmans says:

    Just picking a little nit about naming things…

    Quote: "Myth: Without /3GB the total amount of memory that can be allocated across all *programs* is 2GB". Shouldn’t that be "… across all *processes* …" ?

    Though I haven’t used the feature myself in this form, the .NET framework supports running multiple ‘programs’ within one single process, by running each of them in an AppDomain, isn’t it? I assume all of these ‘programs’ share the same virtual address space, so the 2G or 3G limit applies to the bunch of them together. In other words, running three instances of a WebApp, each of which take 1Gbyte, will cause your webserver process to run out of memory, isn’t it?

    Though not the most common use of the word ‘program’ today, I can envision that soon you will need to clarify what you mean when using the word ‘program’; did you mean ‘process’ or did you mean ‘application’.

  10.   As Evan 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  the fact that he…

Comments are closed.


*DISCLAIMER: I DO NOT OWN THIS CONTENT. If you are the owner and would like it removed, please contact me. The content herein is an archived reproduction of entries from Raymond Chen's "Old New Thing" Blog (most recent link is here). It may have slight formatting modifications for consistency and to improve readability.

WHY DID I DUPLICATE THIS CONTENT HERE? Let me first say this site has never had anything to sell and has never shown ads of any kind. I have nothing monetarily to gain by duplicating content here. Because I had made my own local copy of this content throughout the years, for ease of using tools like grep, I decided to put it online after I discovered some of the original content previously and publicly available, had disappeared approximately early to mid 2019. At the same time, I present the content in an easily accessible theme-agnostic way.

The information provided by Raymond's blog is, for all practical purposes, more authoritative on Windows Development than Microsoft's own MSDN documentation and should be considered supplemental reading to that documentation. The wealth of missing details provided by this blog that Microsoft could not or did not document about Windows over the years is vital enough, many would agree an online "backup" of these details is a necessary endeavor. Specifics include:

<-- Back to Old New Thing Archive Index