117

I know motherboards, BIOS, etc may set upper limits on how much RAM we can install or use on individual machines. However, what defines the maximum RAM for Windows 7 x64?

Is that a fundamental architectural limitation of the OS? Different Windows 7 versions have different RAM maximums (Starter edition <= 2GB, Professional <= 192 GB). Is it something that may be actually changed?

As a comparison, Ubuntu 64x allows for as much as 1024GB RAM.

einpoklum
  • 8,783
  • 20
  • 84
  • 153
Lucas Fortini
  • 1,003
  • 2
  • 7
  • 7

2 Answers2

184

Short answer: the license

Excluding hardware from the equation, it is mostly an artificial software restriction:

[The] limit is retrieved from the registry by calling a function named ZwQueryLicenseValue, which is itself called from an internal procedure which Microsoft's published symbol files name as MxMemoryLicense.

Source: Licensed Memory in 32-Bit Windows Vista

Additional information­

Of course, license data stored in the registry even in an undocumented format might easily be changed by users, which they would have some incentive to try since Microsoft charges significantly different prices for different licenses. Microsoft therefore has an elaborate scheme for checking that the license data remains as Microsoft wants it. The kernel is the repository for whether the licensing data has been tampered with, and to this end exports two more functions, ExGetLicenseTamperState and ExSetLicenseTamperState.

Source: Software Licensing

­

ExGetLicenseTamperState

This [undocumented] function asks the kernel whether the license data has been tampered with.

The internal use is in a timer that recurs approximately every hour. If the tamper state is found to be 4, then Windows stops. The bug check code is SYSTEM_LICENSE_VIOLATION (0x9A), with 0x1B as the first argument.

Source: ExGetLicenseTamperState

A practical example

Let's say you have a computer with 32 GiB of RAM, and you install Windows 7 Home Premium x64 (64-bit). In that case you would be limited to 16 GiB. If you were to use Windows Anytime Upgrade, and upgrade to a more expensive edition, suddenly the limit would be set to 192 GiB instead.

Conclusion

All Windows 7 editions share the same source code. The main difference is the number of features/limitations which are either enabled or disabled. Professional and higher client editions have no upper limit to how much RAM they can handle, and are just licensed to what Microsoft guarantees to support.

Additionally, the Windows 7 EULA explicitly says that you may not "use the software for commercial software hosting services", hinting Microsoft assumed that if you need more RAM that what the highest client edition is licensed to, then what you really want is a server license. Windows 7's server counterpart (that is, Windows Server 2008 R2) can use up to 2 TiB of RAM in the Enterprise and Datacenter editions.

As technology moves fast, what was acceptable yesterday might not be enough tomorrow. In order to catch up, Windows 8 raised the limits to 128 GiB and 512 GiB for the Core and Pro/Enterprise editions, respectively. That only applies to 64-bit versions, though: 32-bit versions are still capped at 4 GiB. The server version, Windows Server 2012, can address up to 4 TiB of RAM in the higher editions.

Further reading

and31415
  • 14,490
  • 3
  • 45
  • 62
  • 32
    This is the best answer because it links to a good source with analysis. – Kevin Panko Feb 04 '14 at 01:09
  • 9
    Just a slight defense: the source code may be the same, but it's not necessarily the same code that would have been there without the support. As an example, a lot of work was done to improve scalability when you have lots of processors (see "global dispatcher lock" here: http://www.tomshardware.com/news/microsoft-windows-server,6589.html). That code is almost certainly the same in all editions, however higher editions of Windows support more CPUs. But supporting more CPUs took more work. Is it fair to charge more for that work? – Mark Sowul Feb 04 '14 at 16:36
  • 1
    The counter-argument could also be made, that they might develop the whole sophisticated thing all at once, but offer a less expensive restricted version for people who do not need the functionality. In the case of hardware, reduced features translates to smaller die size, less complicated memory interfaces, etc. and thus lower production cost. In the software world, cost is almost entirely associated with man-hours of development (and to some extent training / certification). But many consumers are hard-wired to expect an option of paying less for a product that does less. – Andon M. Coleman Feb 04 '14 at 19:20
  • 8
    in short: min(license_limit, physical_limit) – akira Feb 04 '14 at 19:42
  • 2
    @AndonM.Coleman products like Windows that sell so many copies the development costs per license are insignificant compared to most other costs per license. I see online articles saying Windows 8 sold over 100 million licenses in the first 6 months. Over the life of Windows 8/8.1 I expect the development cost per license will be less than the cost of producing a retail box and contents per box. New versions of Windows are typically not written from scratch. Windows 8/8.1/2012 are all VERY similar, and similar under the hood to vista/7/2008. XP/2003/2000 can be grouped together too – BeowulfNode42 Feb 05 '14 at 12:16
  • 5
    Don't get me wrong, the new versions have had work done on them to make them better than the old versions. But things like memory management stays almost identical between versions. A few tweaks are often made as new hardware highlights issues that were not evident in testing before. But the main code stays the same in a product group. – BeowulfNode42 Feb 05 '14 at 12:20
  • 2
    @Mark Sowul The OP question was more geared towards client versions. Consider the less-featured edition: Windows 7 Starter (which is x86-only, BTW). Here they decided to not let people customize the desktop background, a feature available since Windows 95. The code to handle it was already there, they just crippled it. The default wallpaper is set to `%windir%\Web\Wallpaper\Windows\img0.jpg`. The picture SHA-256 hash is hard coded in `shell32.dll`, and is checked every time you log on, restoring the original registry value if changed. That took more work. [Source](https://bit.ly/1ivm9yj) – and31415 Feb 06 '14 at 11:33
  • @akira Thing is Microsoft doesn't talk about a "license" limit. The EULA doesn't even mention the word "memory." The closest related thing is "the legalese's restriction to two processors [which] is not factually correct for all editions." Only Professional and higher client editions are licensed to use two *physical* processors. Everything else is limited to just one. [Source](http://www.geoffchappell.com/notes/windows/license/processors.htm) From the server side, the highest edition (i.e. Datacenter) is licensed to use up to 64 physical processors. – and31415 Feb 06 '14 at 12:29
  • 1
    @and31415 You're right that it's certainly not always a matter of "not adding extra features", and yours is a good example. Usually when this sort of thing comes up in conversation, it seems the lower editions are seen as artificially taking things away, I just wanted to provide another perspective on at least some of those removals. Windows Starter, though is almost solely "make it super cheap and remove enough features to hopefully entice people to at least go up to 'home edition'" – Mark Sowul Feb 07 '14 at 01:14
53

Microsoft licences it that way. They likely want you to go and pay for a Windows Server product that is licensed to run with greater resources. It's the same with other products like SQL Server. SQL Server Express has limitations placed on it so that if you need more resources, you must buy the product that permits it.

Dave Lucre
  • 1,207
  • 10
  • 13
  • 6
    He he, Windows Server is available for free to students ([tag:dreamspark]), so for us, it's more feasible to get that than to buy a copy of Windows... (no affiliation) – gparyani Feb 04 '14 at 02:16
  • 2
    this is one of the reason why 32-bit windows XP and above can support PAE but MS restricts the limit to 4GB of RAM – phuclv Feb 04 '14 at 03:57
  • @LưuVĩnhPhúc support "PAE"? – unknownprotocol Feb 04 '14 at 08:29
  • 1
    32-bit windows is limited not because of licence but because you can't address more than 4GB with 32bits. In fact, it's limited to 2GB and 3GB with PAE from memory because only 31bits are used from memory. But needless to say it's a physical limitation. With 64bit windows it's a logical software limitation imposed by MS licencing – hookenz Feb 04 '14 at 08:36
  • 3
    @MattH the limit to 3GB is because the upper Gig is memory mapped to peripherals – ratchet freak Feb 04 '14 at 08:50
  • @ratchet freak - We're both wrong I just looked it up. http://www.openrce.org/reference_library/files/reference/Windows%20Memory%20Layout,%20User-Kernel%20Address%20Spaces.pdf. – hookenz Feb 04 '14 at 09:01
  • 2
    @MattH That's a common misconception. As an example, take a look at the official [Windows Server 2008 System Requirements](http://msdn.microsoft.com/en-us/windowsserver/cc196364.aspx): "Maximum (**32-bit** systems): 4GB (Standard) or 64GB (Enterprise and Datacenter)." In this case 4 GB is a license restriction, and 64 GB is the [Physical Address Extension](http://en.wikipedia.org/wiki/Physical_Address_Extension) limit (assuming the chipset supports remapping). – and31415 Feb 04 '14 at 14:08
  • 1
    @MattH The usable RAM could be further reduced if reserved by the hardware (e.g. integrated graphic card). You also need to consider that each 32-bit process on a 32-bit Windows is limited to 2 GB, or 3 GB if it's large address aware. The limits in 64-bit Windows are 2 GB and 4 GB, respectively. [Source](http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778%28v=vs.85%29.aspx) – and31415 Feb 04 '14 at 14:26
  • 3
    The reason consumer 32-bit Windows refuses to use more than 4GB of address space is that there are too many legacy 32-bit drivers that aren't aware of PAE and would cause BSODs if used with it. It would be a support nightmare if MS enabled that. – nobody Feb 07 '14 at 03:22