Is the Win7 32-bit kernel still able to use 2 GB with a Large Address Aware program running?

2

I'm currently running Windows 7 Professional 32-bit with 6 GB of RAM.

I use a PAE patch to enable use of more than 3.5 GB of RAM in 32-bit Windows. A similar discussion took place here: How can I enable PAE on Windows 7 (32-bit) to support more than 3.5 GB of RAM?

The link to the patch for Win7 SP1 is here: https://wj32.wordpress.com/2011/02/23/pae-patch-updated-for-windows-7-sp1/

Anyway, long story short, I have the patch installed, but if any of you have played Skyrim may be aware of, the latest version of Skyrim (1.3.10) has the Large Address Aware flag enabled by default to allow it to use up to 3 GB of memory in 32-bit Windows and 4 GB of memory in 64-bit Windows. Of course, to take advantage of this, you also have to set a user environment variable in your BCD entry (userva=3072) to allow the application to use the full 3 GB in 32-bit Windows.

Here's the question: From my understanding from a friend of mine, the 32-bit Windows kernel can only address up to 2 GB of memory for itself. With the PAE patch enabled and using a LAA-enabled application such as Skyrim, would the 32-bit Windows kernel have any problems properly taking advantage of the extra memory available (for example, would it still only be able to address 1 GB because of the original 4 GB limit) or would Windows be able to properly allocate enough memory for itself so that the kernel can use up to the 2GB necessary? Remember, I have 6 GB in my original configuration.

From what I can tell, even if applications aren't designed to work with PAE, one application can still use up to 2 GB before it hits its "limit", so in theory, I can have up to 3 applications using up 2 GB each (pretending Windows isn't taking up any memory, but just a theoretical scenario) and I'd still be fine since Windows is handling where in the memory space these applications are in.

Please feel free to correct me if I'm wrong - I'm not a programmer but I'm kind of curious as to what sort of possible ceilings or walls I'll run into using this configuration.

White Phoenix

Posted 2012-01-02T12:16:36.973

Reputation: 1 271

Answers

4

The physical memory limits and the virtual memory limits are entirely unrelated. One has nothing to do with the other. PAE removes the 4GB limit on physical memory. It has no connection whatsoever on the 3GB/LAA issues that involve virtual memory.

There is one nasty problem though. With 3GB mode enabled, the kernel only has 1GB of address space available. Certain system entries, including entries to track the usage and mapping of physical memory and the entire non-paged pool, must live in that address space. So your OS may be address space constrained. This can cause problems for 32-bit operating systems, especially when other things consume lots of address space, such as high-end video cards.

If this is affecting you, the first symptom will be networking mysteriously failing with odd errors. See, for example, this Microsoft thread.

You never mentioned you're using /3GB. Without it, LAA processes are still limited to 2GB.

From what I can tell, even if applications aren't designed to work with PAE, one application can still use up to 2 GB before it hits its "limit", so in theory, I can have up to 3 applications using up 2 GB each (pretending Windows isn't taking up any memory, but just a theoretical scenario) and I'd still be fine since Windows is handling where in the memory space these applications are in.

No! The 2GB limit is on virtual memory. You have 6GB of physical memory. You can have 50 processes each using 2GB and you won't hit any limit except the per-process limit on each of those 50 processes.

David Schwartz

Posted 2012-01-02T12:16:36.973

Reputation: 58 310

The userva=3072 option is the BCD equivalent of /3GB; it DOES affect process VM space. An LAA app on that system will be able to use up to 3 GB virtual address space, and kernel v.a.s. is just 1 GB. It's worth pointing out that with the OS booted that way, kernel v.a.s. is just 1 GB even if you never run an LAA app. However, Windows 7 32-bit did add "dynamic kernel memory space allocation," so kernel address space is used far more efficiently than it used to be. And the OS will of course still be able to manage all of RAM. – Jamie Hanrahan – 2014-09-26T05:08:03.133

Thanks for the explanation. That's why I was asking, as I was getting a bit confused by the two concepts and if they were interrelated to each other at all. I'm not using the /3GB switch. Like I said, the only change I made to my BCD entry (other than the change necessary to get the patched winload.exe and ntkrnl.exe files to run) was to permanently set the userva option to 3072 (3 GB). – White Phoenix – 2012-01-06T09:42:37.633

1Then you've increased the amount of physical memory the OS can use, but made no changes to virtual memory. Processes are still limited to 2GB of VM apiece. – David Schwartz – 2012-01-06T19:50:13.187

2

The 32-bit Windows kernel can only address up to 2 GB of memory for itself.

Yes -- the kernel won't take more than the upper 2 GB from a program's 4 GB of virtual address space (or more than 1 GB, if you have the /3GB flag and the program is large-address aware). So each app is guaranteed the lower 2 GB of virtual memory (or 3 GB in the latter case).

With PAE, the kernel can use up to 64 GB of physical memory. But each program still has a 4 GB virtual address space. You can't get around this in any way other than by upgrading to a 64-bit system.

From what I can tell, even if applications aren't designed to work with PAE, one application can still use up to 2 GB before it hits its "limit", so in theory, I can have up to 3 applications using up 2 GB each (pretending Windows isn't taking up any memory, but just a theoretical scenario) and I'd still be fine since Windows is handling where in the memory space these applications are in.

Yup.

If an application needs more than 2 GB of physical memory, it must use AWE, but I seriously doubt that the game does this (it's not easy to program for it).

user541686

Posted 2012-01-02T12:16:36.973

Reputation: 21 330

1To be precise, it must use AWE if it needs to access more physical memory than it can with its 2GB of address space. (For example, if it's got a 1GB file mapped in memory, it only has 1GB of address space left to map physical memory.) – David Schwartz – 2012-01-02T14:10:57.207