Dude, Where's My 4 Gigabytes of RAM?

March 8, 2007

Due to fallout from a recent computer catastrophe at work, I had the opportunity to salvage 2 GB of memory. I installed the memory in my work box, which brings it up to 4 gigabytes of RAM-- 4,096 megabytes in total. But that's not what I saw in System Information:

Vista System Information, 4 GB installed, 32-bit operating system

Only 3,454 megabytes. Dude, where's my 4 gigabytes of RAM?

The screenshot itself provides a fairly obvious hint why this is happening: 32-bit Operating System. In any 32-bit operating system, the virtual address space is limited, by definition, to the size of a 32-bit value:

232 = 4,294,967,296
4,294,967,296 / (1,024 x 1,024) = 4,096

As far as 32-bit Vista is concerned, the world ends at 4,096 megabytes. That's it. That's all there is. No ms.

Addressing more than 4 GB of memory is possible in a 32-bit operating system, but it takes nasty hardware hacks like 36-bit PAE extensions in the CPU, together with nasty software hacks like the AWE API. Unless the application is specifically coded to be take advantage of these hacks, it's confined to 4 GB. Well, actually, it's stuck with even less-- 2 GB or 3 GB of virtual address space, at least on Windows.

OK, so we're limited to 4,096 megabytes of virtual address space on a 32-bit operating system. Could be worse.* We could be back in 16-bit land, where the world ended at 64 kilobytes. Brr. I'm getting the shakes just thinking about segments, and pointers of the near and far variety. Let us never speak of this again.

But back to our mystery. Where, exactly, did the other 642 megabytes of my memory go? Raymond Chen provides this clue:

In the absence of the /PAE switch, the Windows memory manager is limited to a 4 GB physical address space. Most of that address space is filled with RAM, but not all of it. Memory-mapped devices (such as your video card) will use some of that physical address space, as will the BIOS ROMs. After all the non-memory devices have had their say, there will be less than 4GB of address space available for RAM below the 4GB physical address boundary.

Ian Griffiths offers a more detailed explanation:

To address 4GB of memory you need 32 bits of address bus. (Assuming individual bytes are addressable.) This gives us a problem - the same problem that IBM faced when designing the original PC. You tend to want to have more than just memory in a computer - you need things like graphics cards and hard disks to be accessible to the computer in order for it to be able to use them. So just as the original PC had to carve up the 8086's 1MB addressing range into memory (640K) and 'other' (384K), the same problem exists today if you want to fit memory and devices into a 32-bit address range: not all of the available 4GB of address space can be given over to memory.

For a long time this wasn't a problem, because there was a whole 4GB of address space, so devices typically lurk up in the top 1GB of physical address space, leaving the bottom 3GB for memory. And 3GB should be enough for anyone, right?

So what actually happens if you go out and buy 4GB of memory for your PC? Well, it's just like the DOS days - there's a hole in your memory map for the IO. (Now it's only 25% of the total address space, but it's still a big hole.) So the bottom 3GB of your memory will be available, but there's an issue with that last 1GB.

And if you think devices can't possibly need that much memory-mapped IO, I have some sobering news for you: by this summer, you'll be able to buy video cards with 1 GB of video memory.

To be perfectly clear, this isn't a Windows problem-- it's an x86 hardware problem. The memory hole is quite literally invisible to the CPU, no matter what 32-bit operating system you choose. The following diagram from Intel illustrates just where the memory hole is:

Intel system memory map

The proper solution to this whole conundrum is to use a 64-bit operating system. However, even with a 64-bit OS, you'll still be at the mercy of your motherboard's chipset and BIOS; make sure your motherboard supports using 4 GB or more of memory, as outlined in this MSKB article.

264 = 18,446,744,073,709,551,616
18,446,744,073,709,551,616 / (1,024 x 1,024) / 8 = 2 exabytes

In case you're wondering, the progression is giga, tera, peta, exa.

Although the performance benefits of 64-bit are somewhat dubious on the desktop, a 64-bit OS absolutely essential if you run applications that need to use more than 2 GB of memory. It's not common, but we're getting there.

The memory hole for IO still exists in the 64-bit world, but most modern BIOSes allow you to banish the IO memory hole (pdf) to some (for now) ridiculously high limit when you're running a 64-bit OS. Don't get too excited, though. The user-mode virtual address space in 64-bit Windows is a mere 8 terabytes. Suffice it to say that we won't be running out of physical or virtual address space on 64-bit operating systems for the forseeable future. It's the final solution, at least for the lifetime of everyone reading this blog post today.

Here's one parting bit of advice: if, like me, you're planning to stick with a 32-bit operating system for the next few years, don't waste your money on 4 GB of RAM. You won't be able to use it all. Buy 3 GB instead. Every motherboard I'm aware of will happily accept 2 x 1 GB and 2 x 512 MB DIMMs.

* Could be raining.

Posted by Jeff Atwood
287 Comments

Brandon Paddock wrote "To those claiming Linux doesn't have this problem: You're wrong. A 32-bit Linux OS will have the exact same limitations, right down the the kilobyte."

But what about 64-bit Linux?

keylime on March 9, 2007 1:00 AM

Jeff:
Your math is incorrect. In both calculations, you forget to convert from bits to bytes (8 bits = 1 byte). Also, you're not considering memory paging. Without paging, x86 processors using a 32 bit address word can only access 0.5 GB of memory. See http://spreadsheets.google.com/ccc?key=pYK6MlUiNyheNUOvbGxggNQhl=en_US for the math. NOTE: Clicking the sheet names at the bottom displays different calculation sets.

FWIW, I completely agree with Ian (and others) when he says that the issue isn't quite as facile as Jeff's thesis makes it seem. Look at Mac OS X: it's (now) a 64bit kernal, but the maximum amount of RAM a MacBookPro will take is 4GB, while a MacBook will only handle 3GB. The MacPros, however, handle up to 16GB of RAM. Different chip set, same OS = different specs. Apple simply didn't include the extra hardware to allow higher memory configurations.

Jae:
x86 is a processor architecture. 'Nbit' (where N is 16, 32, 64, etc) refers to the word size a processor operates on. x86 processors began with 16bit word sizes, moved to 32 and are moving to 64.

One (very inexact) way to think about it is to say that CPUs are like internal combustion engines. They may differ in how the bits fit together, how many bits there are or even how quickly they do their jobs. But, basically, they're all pretty much alike: fuel comes in, combustion happens, piston moves, and wheels turn.

Word size can be likened to the amount of pistons an engine has; more pistons means more fuel is combusted (work is done) every cycle. Also, relevant to the above discussion, larger word size means more physical address lines are available (32 more, in this case). See above link for the math behind this.

Josh Butcher on March 9, 2007 1:09 AM

That link should've been: http://spreadsheets.google.com/ccc?key=pYK6MlUiNyheNUOvbGxggNQhl=en_US

Josh Butcher on March 9, 2007 1:10 AM

If your hardware is physically capable of addressing more than 4gb of RAM (this can be limited in the chipset), then you can access up to 64 gigs of RAM with Linux in 32-bit mode. Using PAE, which is invisible to applications, you just don't have to worry about system memory; if you've got it, you can use it.

However, I think there's still a 2gb limit per process, 3 if you use a special boot parameter to the kernel. You can run a lot of 2gb processes, but can't run a single 32-gig program, as far as I know.

If, of course, you have a 64-bit CPU, you can use as much RAM as you like. Programs can easily use all the RAM too, but they do have to be recompiled for 64-bit. 32-bit compiles are still limited to 2 or 3 gigs.

Linux is a pretty damn good solution, overall, but the 32 to 64-bit transition is painful on all OSes. Linux runs 32-bit code quite nicely when the kernel is 64-bit, but you can't use a 32-bit plugin, like Flash, with a 64-bit Firefox. You have to be aware of the differences and work around occasional problems.

It'll probably be least visible on the Mac. They go to great pains to hide the 32- versus 64-bit problems.

Malor on March 9, 2007 1:12 AM

Actually it is O/S issue http://www.microsoft.com/whdc/system/platform/server/PAE/PAEdrv.mspx

Shows that XP is limited to 4GB whereas Datacentre is limited to 128GB! Once you start dealing with kit in this range ($80K+) you want to have all your RAM available - (why do you want 16GB? well if you have a 20GB database and it gets hammered you want in RAM)

http://support.microsoft.com/kb/283037 describes what happens with /3gb and /pae

If you really want to see problems - check out "Desktop Heap" http://support.microsoft.com/kb/126962 http://support.microsoft.com/default.aspx?scid=kb;EN-US;184802

The desktop heap is set on 32-Bit systems to 48MB! That's all, and on servers where processes can run as users, it's a problem. The limit is about 90 users (each starting out with 512KB used) on a box as more than this (48/.5=96) starts to hit the usage by system/service accounts. see http://support.microsoft.com/kb/169321 on how windows can start a new process in a new windows desktop

alister on March 9, 2007 1:18 AM

Very good article. I work on BIOS for a living, and I have to give this explanation to testers all the time.

Which platforms are mote likely to support remapping over 4GB ... servers. Most desktops and notebooks won't support it.

If the memory controller will support remapping memory above 4GB, then you're fine. The "memory hole" will get pushed up over 4GB. If not, then you lose that memory to all of the PCI devices on the system.

On AMD Athlon/Turion/Opteron platforms, the memory controller is in the CPU. On Intel platforms, this is the MCH/GMCH (also called a "northbridge").

spambrian on March 9, 2007 1:51 AM

In any 32-bit operating system, the physical address space
is limited, by definition, to the size of a 32-bit value

No... the /virtual/ address space is limited to 32 bits. It's possible to have more /physical/ memory than this, and it's even useful if you want to run more than one large process at a time. PDP-11s did this, AFAIR.

I don't know enough about Windows or Intel architecture processors to know whether this is possible in that environment, though.

John on March 9, 2007 2:18 AM

Do you need 4gigs of ram on a desktop machine though?

Well a few years ago I would have laughed at you but seeing how 2gigs actually makes a difference in Vista due to the improved memory management, I'd have consider going for it... If it didn't mean I had to scrap my 4* 512 stick... But I guess even that's off the table until people stop faffing around with 32bit desktop applications and decide they're bored of it.

Oli on March 9, 2007 2:25 AM

John: you're absolutely right. Corrected.

And the 36-bit PAE Intel extensions are what you're thinking of, but they're still a nasty hack. Far better to lace up your boots and go 64-bit now that AMD blazed the trail.

Jeff Atwood on March 9, 2007 2:26 AM

I'm getting confused with all these comments, eheh. Isn't there a difference between physical memory and virtual memory? Can't the x86 architecture handle enormous amounts of virtual memory?

What I'm being taught in college is that certain memory addresses are reserved for ROM memory and I/O devices. And since the physical limit is 4GB, if you have addresses that are fixed to other devices than what we know as the RAM memory, then you won't use all those 4GB because a portion of those 4gb is not even addressable.

That's what I understand, anyway. But then I heard that there is virtual memory, but that's where those pagefiles come into play, I guess. I still don't understand it very well :P

Julius on March 9, 2007 2:26 AM

When I built up my current PC I chose "Windows XP x64 Pro" for this very reason (plus I didn't see the point in restricting my shiny new 64-bit CPU).

Sadly support for XP x64 has been mediocre at best. Some major hardware players (e.g. Netgear) have outright refused to produce drivers for it. Others have produced cut-down software that functions, but misses important features when compared to the 32-bit version.

Even Microsoft, who marketed x64 as meeting the "increasingly sophisticated demands for making home movies, working with digital photographs, using digital media" have not issued x64-compatible versions of their "Color Control Applet" or the "RAW Thumbnail Viewer" - both of which would be very useful add-ons for people working in exactly those fields.

Given this experience I am watching Vista 64-bit with quiet interest. A quick trawl around various hardware websites shows that most drivers offered are labelled as Vista 32-bit only. Is history set to repeat itself?

GrahamStw on March 9, 2007 2:27 AM

"It's the final solution, at least for the lifetime of everyone reading this blog post today."

You really want to say something like that? I remember getting a 16k expansion for my Apple II+ (cost $200 and brought me to 64k). I would bet that 64bit isn't enough to last the next 40 years, probably not the next 20.

Jiro on March 9, 2007 2:29 AM

Graham, I expect the driver situation to be much better with Vista x64. The 64-bit version of XP release was a weird, out-of-band release that never had proper levels of support. XP was released in 2001, and x64 XP was released in, what, 2005? That's weird.

But with Vista, x64 is a first-class citizen, released at the same time alongside all its x86 brethren.

Of course it'll still take time. Some companies still don't have plain old x86 drivers for Vista that are any good. But within the next 2 years, I expect x64 driver support to at rough parity with x86.

Jeff Atwood on March 9, 2007 2:32 AM

[quote]In case you're wondering, the progression is giga, tera, peta, exa.[/quote]

Nope.
Because you are obviously talking powers of two, the progression is gibi, tebi, pebi, exbi.
(http://en.wikipedia.org/wiki/Binary_prefix#IEC_standard_prefixes)

Mihai on March 9, 2007 2:33 AM

I'm a little disappointed with my recent install of Windows Vista (32bit). I have three gigs of ram (2x1GB 2x512mb) but BIOS and Vista only recognizes 2GB (the 2x1GB sticks). When I run applications like CPU-Z in Windows, it recognizes all four sticks. This isn't the same issue but kind of related. Wondering if anyone had any idea what was going on? I was thinking the sticks were just not compatible but I'm not positive.

raid5 on March 9, 2007 2:36 AM

"Suffice it to say that we won't be running out of physical or virtual address space on 64-bit operating systems for the forseeable future. It's the final solution, at least for the lifetime of everyone reading this blog post today"

Eh? I remember when the Mac II came out, the article in MacWorld being amazed at the vast 4 gigabyte address range addressible by its 32 bit processor and proclaiming that we'd never hit that limit. Not to mention the old (if apocryphal) 640k-should-be-enough-for-anyone chestnut. You're falling into the same trap.

Starting with 4GB, and assuming Moore's Law holds constant, we hit 8192GB in 16 and a half years. I'm 27 now, and I damn sure intend to still be alive when I'm 44.

Allan Crain on March 9, 2007 2:39 AM

Julius:
"Isn't there a difference between physical memory and virtual memory? Can't the x86 architecture handle enormous amounts of virtual memory?"

Yes and yes (depending on your definition of enormous, I suppose).

Physical memory is just that, the 'sticks' you physically plug into slots inside your computer. Virtual memory, in a nutshell, refers to the method of an OS presenting non-contiguous memory as if it were contiguous. It’s an abstraction layer. Often times this means that some of the non-contiguous memory is actually a file on the hard disk, 'swapped' into and out of RAM as it's needed.

"What I'm being taught in college..."

Sounds like they're telling you the truth. During boot-time, some peripherals are assigned memory locations that the CPU reads from/writes to. This happens dynamically now (Plug-And-Play) but in the past, folks used to have to set the memory address themselves via DIP switches. That sucked. Reassigning these memory locations during runtime isn't normally done (never, as far as I know).

"But then I heard that there is virtual memory, but that's where those pagefiles come into play, I guess."

Pages (pagefiles) may be files on disk or regions of memory or even something else (Vista lets users plug in a USB thumb drive to increase system memory). They don't *have* to be files on disk.

See http://en.wikipedia.org/wiki/Virtual_memory for more info.
See my above link for some background math.

Josh Butcher on March 9, 2007 2:49 AM

You say [quote]"To be perfectly clear, this isn't a Windows problem-- it's an x86 hardware problem. The memory hole is quite literally invisible to the CPU, no matter what 32-bit operating system you choose. The following diagram from Intel illustrates just where the memory hole is: image"[/quote]

and then show an image of a DOS compatible memory layout. As far as i'm aware, the only OS to actually use this kind of layout would be from a certain company in Redmond. I know none of my machines have a DOS compatibility region in place, so i would say this in fact _is_ a windows issue, not and x86 one.

Kris

kris on March 9, 2007 2:51 AM

Jeff, I do hope things will improve, but I won't be convinced that 64-bit has hit mainstream until I see major OEMs shipping PCs with Vista 64 installed as standard.

Personally I wish Microsoft had *only* released a 64-bit version. After all, it is supposed to be the OS for the next generation of PCs isn't it? And I doubt many of them will be 32-bit.

Paul Thurrott makes some important points on his Windows SuperSite:
http://www.winsupersite.com/showcase/winvista_ff_x64.asp

GrahamStw on March 9, 2007 2:55 AM

Jeff:

" Exactly where is that magical PAE memory supposed to appear?

It'll only "appear" in apps that explicitly code to support the AWE (address windowing extensions) API, which makes use of the PAE extensions in the CPU. I don't think the base OS does this, but applications might.
"

No - PAE increases the available pool of memory in total. AWE isn't directly connected with it, though the two go together from necessity for super-huge apps on 32-bit.

a href="http://blogs.technet.com/tristank/archive/2006/05/27/430507.aspx"http://blogs.technet.com/tristank/archive/2006/05/27/430507.aspx/a

TristanK on March 9, 2007 3:02 AM

Man, are you sure 4GB will be _enough_ at all, for Windows Vista?

Salvatore Iovene on March 9, 2007 3:08 AM

"Virtual memory, in a nutshell, refers to the method of an OS presenting non-contiguous memory as if it were contiguous."

Of course in practice, on 32bit Windows, you still have the problem of actually getting a contiguous memory block greater than ~1.5Gb.

Windows maps drivers and suchlike at the bottom of the virtual memory for each process, then at around 2Gb, you'll find it places system dll's! So your poor process can never actually map a contiguous block of memory 1.5gb, even though it can access 1.5Gb + memory from the upper limit (~1Gb) using the /3Gb switch.

A _real_ pain when you're constrained to 32Bit Windows and attempting to create memory hungry processes used memory mapped files for shared mem.

http://msdn2.microsoft.com/en-gb/library/ms810613.aspx

Jamesm on March 9, 2007 3:14 AM

Jamesm:
"Of course in practice, on 32bit Windows, you still have the problem of actually getting a contiguous memory block greater than ~1.5Gb."

I didn't say the OS had to be any good at it... :)

Josh Butcher on March 9, 2007 3:19 AM

Nice article, again. You mentioned BIOSes that move the mapped PCI memory to a very high address. Actually the Asus BIOS I have works the other way round: the RAM between 2 GB and 4 GB is remapped to 4+ GB.

I've recently upgraded to 4 GB because I'm dumb and curious and have too much money. Now I found that I have to enable this setting when running Memtest86 1.70 so that it can see all 4 GB. It will test them in to chunks: 116KB (or so) to 2 GB, and 4 GB to 6 GB, because that's where the BIOS has mapped the second 2 gigs.

But for booting Windows (XP 32-bit) I have to disable memory remapping in order to get at least a measly 3 GB (the 8800's video RAM takes up all the rest!).

Chris Nahr on March 9, 2007 3:28 AM

Here's Microsoft's guidance on what operating systems support the 36-bit PAE extensions, and what the memory limits are for each:

http://www.microsoft.com/whdc/system/platform/server/PAE/pae_os.mspx

It hasn't been updated for Vista yet, but here are the physical memory limits from Thurrott:

Starter: 256 MB (!)
Home: 8 GB
Home Premium: 16 GB

every other edition of Vista will use as much physical memory as the hardware supports.

Jeff Atwood on March 9, 2007 3:31 AM

AWE = EMS for the early Noughties :)

TristanK on March 9, 2007 3:57 AM

no.. This is a real system: [snipped]

cat /proc/meminfo

[ 16 GB RAM ]

cat /proc/cpuinfo

[ 4 Opteron 2.4 GHz dual-core CPUs ]

Dan on March 9, 2007 4:03 AM

Kris, I think how did you correlate the limitation of 32bit addressing with DOS compatibility?

Damian on March 9, 2007 4:05 AM

So if I really want everything I get out of my memory, don't I want 3x 1GB sticks, AND 1x 512MB stick?

then you loose the dual channel benefit.

18,446,744,073,709,551K of RAM ought to be enough for anybody.

anyway since windows has a limited life..(vista is like 5 year support)

NBC on March 9, 2007 4:08 AM

So... if we buy x64 hardware, will a 32 bit OS still see all 4 GB, or do you have to have a 64 bit OS as well?

I won't be going to a new OS anytime soon ( I want Vista, and don't have the money for it yet). But my church is looking at upgrading to 4GB in the recording computer...

Eric D. Burdo on March 9, 2007 4:53 AM

haha great jeff! very interesting this article!
its silly but i never thought about a limit like that in the modern computer architecture.
i just hope to live until the day that i can say: dude!! where are my 19 EB (aka Exabyte)??? hahah

ps. hey jeff i would to suggest you the topic of one of your next articles, cause i was thinking if exist a diet, or better like position to improve productivity for programmers cause i am getting pretty fat haha :D. sorry i go always off topic. Regards.

Donnie from Rome on March 9, 2007 5:06 AM

Actually, the physical processor does have, to this day, DOS compatibility in microcode and bios. (Maybe in stub form, running DOS probably won't actually work anymore with new hardware anyway, I don't know if anyone's even tried it in years.) When they say x86 ISA is 'legacy baggage' they don't just mean the silly register layout and instruction set.

The northbridge or HT bridge controls all access to memory, both DRAM and PCI chips (and bios and other device junk), and it's the one that initializes PCI devices into certain slots. That's why the cpu, and thus the OS, is incapable of seeing through it.

Foxyshadis on March 9, 2007 5:06 AM

That, my friends, is why Apple does not offer 4GB of RAM in laptops. Which makes me wonder how all the other manufacturers explain to the rich idiots who splurged their kilobucks on their loaded Lenovos, Toshibas and HPs, why they can't see all of their expensive RAM.

DMB on March 9, 2007 5:06 AM

"The user-mode virtual address space in 64-bit Windows is a mere 8 terabytes.... It's the final solution, at least for the lifetime of everyone reading this blog post today."

You think? In the early 90's, I had a computer with 2MB of RAM. Today (17 years later), it is feasible to have 4GB. That's 2,000 times more memory. If the same trend continues, we could have 8TB by 2024. Certainly within most of our lifetimes.

Jeremy on March 9, 2007 5:25 AM

If and when Adobe's new InDesign Suite goes to 64bit, then I will certainly buy a PC to take full advantage of those available features. Until then I will just continue to run at 2GB RAM.

Michael on March 9, 2007 5:30 AM

Kris, you are embarrassing yourself with such comments, so the 1MB "DOS compatibility" is what makes the 4G limit ? LOL.

PL on March 9, 2007 5:31 AM

Ya know, I thought it was common to be using the PAE kernel these days, at least on recent NX-capable hardware.

You haven't disabled DEP, perchance?

http://msdn2.microsoft.com/en-us/library/ms791508.aspx

I'm running X64 at home and at work, so can't readily check :)
Mental note to look that up sometime.

TristanK on March 9, 2007 5:32 AM

Jeff, I think you should edit this article, because your recommendation:

"The proper solution to this whole conundrum is to use a 64-bit operating system"

is misleading, and may well cause people serious grief. There are loads of systems out there with 64-bit CPUs that only have a 32-bit physical address range. For example, the vast majority of laptops only have a 32-bit physical address range, even though many are now available with 64-bit CPUs. And plenty of desktop systems have the same issue.

People following your advice are liable to put themselves to the inconvenience of switching to a 64-bit OS only to find that it doesn't actually solve the problem - they're still limited to 3.5GB of RAM, but now they have the additional problems that half their devices are no longer properly supported, and their OS now has a bigger memory footprint thus *reducing* the amount of memory available for doing useful work... Most people will not regard this as an improvement, and they could reasonably be annoyed with your advice.

The bottom line is this: a lot of chipsets only use 32 address bits - the higher order address bits on the processor are not wired up to anything more than terminating resistors. Turning on /PAE or switching to 64-bit won't help you if you have such a chipset because the CPU doesn't have a way of asking for stuff above the 4GB mark. 64-bit will let you get more than 2GB of *virtual* address space in a process, but you'll still be stuck with 3.5GB or so of physical memory.

So if I were you I'd qualify your recommendation before you get a horde of angry people beating a path to your door... Make it clear that you need to have a suitable chipset. Moreover, if you do have a suitable chipset you probably don't actually need to go 64-bit. /PAE may actually be a better option in reality, given today's less than total support for 64-bit. PAE may be a hack, but who cares? The OS deals with it; it's no uglier than the fact that my machine has 4GB of virtual memory (my physical memory + page file is 4GB, on my 32-bit system). 64-bit isn't about breaking through the 4GB barrier of physical addressing - it's only really useful if you've hit *virtual* address space limits, which is really a completely different class of problem than the one you open this blog entry with.

(Although if you need more than 64GB of memory, I believe 64-bit is necessary. PAE only goes up to 64GB of physical address space.)

In short: the 3.5GB problem is usually a chipset thing, not a 32 vs 64 thing. Unless you have individual processes requiring more than 3GB of memory, /PAE is often a better solution. (With most people I know who need this much memory, it's because they are hosting a couple of VMs, and /PAE is just fine for that.) And if /PAE doesn't work on your system, switching to 64-bit probably won't either.

Ian Griffiths on March 9, 2007 5:35 AM

Thanks for the tip....I am in the process of planning my new rig and was about to make that mistake. The problem is that I can't afford to lose all of the programs that don't run well (or at all) on the 64 bit OS. And I hear that drivers for Vista 64 are a nightmare so I guess 3 gigs of ram it is.

----
John
http://www.monomachines.com

John on March 9, 2007 5:40 AM

I'm in the same boat as Graham, well not exactly, I can't even find all the proper drivers for 32 bit Vista. So it's a waiting game to first get all the necessary drivers for my hardware then for the applications I require to be compatible.

Kevin Taylor on March 9, 2007 5:50 AM

Nobody will ever need more than 4 X 10^24 exabytes of memory...

Gee, I wonder what the equivalent neural capacity of the brain is...

Oops, were comparing apples to kiwis, or should I say analog to digital.

If there is one thing that I've learned, if you offer more hardware capacity it will be used.
"Is your name Sahra O'Conner?"

Rabid Wolverine on March 9, 2007 5:57 AM

Here's a nickel, kid. Go buy yourself a real computer.

nitrogen:~# cat /proc/meminfo
MemTotal: 4051648 kB
MemFree: 66600 kB
Buffers: 360016 kB
Cached: 2215200 kB
SwapCached: 12 kB
Active: 818808 kB
Inactive: 2175504 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 4051648 kB
LowFree: 66600 kB
SwapTotal: 9823672 kB
SwapFree: 9823244 kB
Dirty: 272 kB
Writeback: 0 kB
Mapped: 449972 kB
Slab: 970272 kB
CommitLimit: 11849496 kB
Committed_AS: 799204 kB
PageTables: 4424 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 5024 kB
VmallocChunk: 34359733327 kB

Eugen Leitl on March 9, 2007 5:58 AM

I ran into the exact same problem on my Vista 32-bit box... the memory showed up properly in the BIOS, but not in System Information. It turns out that Microsoft recently released a KB article to describe the problem (although they didn't go into the level of depth that you did... great job!)

http://support.microsoft.com/kb/929605/en-us

The system memory that is reported in the System Information dialog box in Windows Vista is less than you expect if 4 GB of RAM is installed

Sean on March 9, 2007 6:00 AM

Ian, what 64 bit chipset uses 32 bit addressing ? That is by definition not a 64 bit chipset then, sounds very strange to me but it wouldn't suprise me if you are correct that some do (probably Intel).

Go with AMD64 which was the orginal inventor of the EM64 extensions that Intel then "stole" (yes I know they can with the patent agreement from -94) and you'll most likely be safe from such issues.

As for the prople coming here posting some printouts from various *nix systems, you really need to read the article again, this is NOT a Windows issue, my good, you are embarrasing.

PL on March 9, 2007 6:05 AM

I'm currently running an Intel Core Duo that is about a year old and it simply isn't x64 capable. This is in response to the poster who "wished Microsoft had only released an x64 version of Vista". They would have left a lot of us out in the cold.

With that said, you can see why many hardware manufacturers haven't been too quick to come on board. x64 Win XP has only been used by a select few to date because you would have had to buy fairly high end processors to even run it. Only now are mass consumers finally being offered processors that can support the x64 OS's (at least for Intel).

Matt on March 9, 2007 6:30 AM

bah, Eugene, here's a _real_ system:

root@/proc# cat cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 6
model name : Intel Celeron ("GenuineIntel" 686-class, 128KB L2 cache)
stepping : 5
cpu MHz : 501
fdiv_bug : no
fpu : yes
fpu_exception: : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr

root@/proc# cat meminfo
total: used: free: shared: buffers: cached:
Mem: 257118208 62099456 195018752 0 0 0
Swap: 511995904 0 511995904
MemTotal: 251092 kB
MemFree: 190448 kB
MemShared: 0 kB
Buffers: 0 kB
Cached: 0 kB
SwapTotal: 499996 kB
SwapFree: 499996 kB
cat: meminfo: Invalid argument

David H. on March 9, 2007 6:49 AM

"Could be raining!"

I just watched that movie last night, and I read this blog post directly afterwords. What are the odds?

TM on March 9, 2007 6:51 AM

You know what's funny? I am running 4GB of physical RAM on 64bit hardware, but I don't have a 64-bit version of my O/S. I really should upgrade, but since I get to see 3.4 GB of it anyway, there's not much incentive...

Elliott C. Bck on March 9, 2007 7:02 AM

Matt, I disagree that only now are consumers getting x64 CPUs. Athlon64s have been available since late 2003. I built my current PC in September 2005 and I specced it with an Athlon 64 X2 3800+ which wasn't unusually expensive or "high-end" even back then.

Look at a major manufacturer like Dell and even some of the cheapest amd most basic systems they offer use 64-bit capable CPUs.

Okay, perhaps it is too much to expect Microsoft to exclude 32-bit completely, but why is it the default? It currently isn't possible to buy a retail version of Vista 64. Instead you buy the 32-bit version and then follow the instructions inside to send off for the 64-bit one!

Given my experiences with XP x64, I don't find that approach very comforting.

GrahamStw on March 9, 2007 7:02 AM

On the whole 64-bit / x86 that was mentioned earlier in the comments...

I avoided 64-bit carefully for a number of reasons. First, X32 is the supported standard, and I knew that Intel was coming out with multi-core processors. I figured, and I think I may have figured correctly, that people were going to be more willing to figure out multi-threading than they were going to be willing to figure out X64 architecture. I sort of saw this coming when Apple began releasing dual-processor G5s several years ago.

Much as I think the whole concept of "more processors equals better computer" argument is rather silly, it is the way the industry tends to trend. I mean, it took years for all the die-hard Apple fans to swap from Motorola to PowerPC chipsets, and they only did that because they more or less had to for speed purposes. Apple continued to support FAT applications right up the the release of OS X.

To this point, most PCs since the industry really got off the ground with the 8086 have all been based on that exact architecture. S'why we call 'em X86. Of course, I never knew if "286" was short-hand for 8286, or if it literally went 8086, 268, 386, 486, Pentium, Pentium II, Pentium III, Pentium 4, Intel Core Duo, etc. I'm sure I've missed one or two iterations in there.

I'm hoping they're going to have the quad-cores available for purchase this summer when I'll be trolling for yet another new computer. If they don't, I'll probably just max out a dual core system. It's something, anyway.

Jae on March 9, 2007 7:20 AM

@Josh,

Last I checked, the machine addresses memory in bytes, not bits...

LS on March 9, 2007 7:22 AM

I did have a point in there: adoption will be slow, but it WILL happen, eventually.

My curiosity is that since I never really studied 64-bit, what is its relationship to X86?

Jae on March 9, 2007 7:27 AM

Ian, using /PAE to address memory 4 GB on 32-bit systems has its own problematic issues, according to Microsoft. There's a performance penalty because I/O requests from 32-bit devices must be double-buffered, and some devices might not work at all, depending on the driver. I wouldn't want to recommend THAT to a general audience, either!

Chris Nahr on March 9, 2007 7:28 AM

"Ian, what 64 bit chipset uses 32 bit addressing ? That is by definition not a 64 bit chipset then, sounds very strange to me but it wouldn't suprise me if you are correct that some do (probably Intel)."
By the logic of the chipset/motherboard manufacturers supporting stuff that customers are unlikely to use is pointless, and thus it's unusual for motherboards to support the full address range of the CPUs they have. After all how many customers are going to have more than 2gb of memory?

Factory on March 9, 2007 7:33 AM

@Brandon: I didn't say Apple is(n't) 64bit. I was replying to your statement saying Apple's "behind the times technology-wise" - I even said that was what I was replying to.
If any mainstream OS is behind the times technology-wise, it's obviously Microsoft's.

Ludo on March 9, 2007 7:35 AM

Okay, I just checked... my XP SP2 Pro system has PAE enabled (comes automatically with DEP). So for shits and giggles I enabled memory remapping in the BIOS and rebooted Windows. I know from MemTest that 2 out of my 4 gigs will now appear in the 4-6 GB range.

Yet Windows tells me that it has only 2 GB total! Total available memory, according to Task Manager: 6 GB = 2 GB RAM + 4 GB page file.

Exactly where is that magical PAE memory supposed to appear?

Chris Nahr on March 9, 2007 7:40 AM

Mac Pro handles up to 16GB of RAM and 3TB of disk space.

Two 3GHz 64-bit Dual-Core Intel Xeon “Woodcrest” processors.

http://www.apple.com/macpro/specs.html

And with Parallels, you can run Windows, Linux, and MacOS x at the same time.

http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html

Charles Kens on March 9, 2007 8:02 AM

Charles: Mac OS has always been a little ahead of the curve in what sizes it will handle, both in RAM and Hard Drive capacity.

I seem to recall Macs handling the GB threshold more easily than did PCs.

Jae on March 9, 2007 8:11 AM

To be perfectly clear, this isn't a Windows problem-- it's an x86 hardware problem

Indeed. The latest Intel Core Duo-based iMacs have the same issue. You can put 4GB in them, but they'll never be able to use more than 3 GB.

Dave C. on March 9, 2007 8:29 AM

"It's the final solution, at least for the lifetime of everyone reading this blog post today."

Are you serious? I was a kid when we were still in the world of kilobytes, and now we're tossing around gigabytes like candy. We could very well be fooling around with petabytes before I'm dead, though we probably wouldn't be doing it on Vista.

CrashCat on March 9, 2007 9:03 AM

"Suffice it to say that we won't be running out of physical or virtual address space on 64-bit operating systems for the forseeable future. It's the final solution, at least for the lifetime of everyone reading this blog post today".

Wrong statement. I'm not yet in my 30, and I've seen how addressing has grown from 640k to 4GB and then became short. That's a x6250 factor!! 4GB to 8TB it's only a x2000 factor, and HD video and photorealistic games didn't come yet.

danner on March 9, 2007 9:04 AM

So if I really want everything I get out of my memory, don't I want 3x 1GB sticks, AND 1x 512MB stick?

JJ on March 9, 2007 9:14 AM

Thanks for an interesting post. I'll have to look into it some more because I'm faced with this same issue right now.

I have a ASUS A8N32-SLI Delux mobo with 4 gigs or RAM. (4 * 1GB - Dual sided). When I go into the bios, it tells me that there is 4GB installed but only 3.38 Avail for use. Now I'm not sure if this is a bios issue or a mobo issue but if anyone has any clue, I'd love to hear it. (I'm planning an upgrade to my bios sometime this weekend - maybe that might work?).

I also have Vista 64 bit installed with VPC 2007 (The reason for my 4gb is so I can run an XP image with ease).

Sushant Bhatia on March 9, 2007 9:34 AM

Most of this went over my head, but I have a brand new intel core 2 with 4gb of ram, only 3070mb showing in windows. Dell support showed me in the bios that 4gb was there.

The issue is, I also had it installed with Office 2007 and what a memory hog it is! Right now I have Outlook 2007 open, along with a browser and I'm running at 55% of memory used.

I wondered if adding more memory was an option...guess not. :(

Good read..thx for the info.

Ron

Ron on March 9, 2007 9:35 AM

64-bit processors have been around, but not everyone buys or feels comfortable buying AMD. There are the hardheaded people that use what they grew up with and that's Intel. However, it seems like EVERY system I see advertised either has a Intel 64bit or AMD 64bit processor in it. To all those people I say "your welcome" as I have been running my AMD FX55 since the thing came out. I tried XP 64-bit when it came out, and not only did I have driver issues, I had software issues getting Flash to run in IE, etc.

Now I am running Vista Business 64-bit edition and I must say there is great 64-bit driver support. If the company has a 32-bit Vista driver chances are they have the 64-bit edition too. Some companies like HP don't have Vista drivers yet for all their printers, their short term resolution is to use the USB cable instead of the Network connection for things like Fax/Scanning. Other companies like Razer don't even have Vista drivers yet.

This leads me to my point, how long have these companies known Vista was coming? You can truly see which companies are dedicated to ensuring there products work with any OS and those companies that are just too small to spend the time developing drivers for every OS. Logitech Razer, etc. Suprisingly about the only Vista driver Razer does have is for the Habu mouse they make for Microsoft.

But for those of you thinking about upgrading to 64-bit OS, do it! There is no distinguishable issues that I have run into outside of the lack of general Vista (32bit and 64bit) driver support for some of my devices. I am able to run IE, Firefox, Adobe CS2, Unreal Tournament 2004, Open Office, Office 2007, etc without issue. To me after I disabled all the extra stuff (Defender, Firewall, System Restore), I swear Vista boots faster then my old XP install.

And the Vista GA release doesn't crash like the RC1 version did either. There is a good availability of virus software out there, personally I use Kasperky. If you bought or are thinking about buying a new system that has a 64bit CPU, you paided for it, might as well use it!

Tim on March 9, 2007 9:37 AM

CrashCat had a good point.

"It's the final solution, at least for the lifetime of everyone reading this blog post today."

Note that you're talking about problems addressing 4GB in 2007, and also quote Ian Griffiths mentioning how the 8086 (designed in 1976) had to carve up 1MB. If that growth rate were to continue, we'd be looking at addressing 16TB in another 31 years. Of course we won't be using Vista then. (We aren't really using it now but that's another topic.)

I suspect it will be a lot less than 31 years until we see wide consumer adoption of some kind of terabyte-level optical memory or something else that leaves Moore's Law in the dust.

Dave on March 9, 2007 10:03 AM

Mac Pro handles up to 16GB of RAM and 3TB of disk space.

Kind of academic, since OS X itself is not fully 64-bit.

http://arstechnica.com/reviews/os/macosx-10.4.ars/4

So if I were you I'd qualify your recommendation before you get a horde of angry people beating a path to your door... Make it clear that you need to have a suitable chipset [to use 4 GB+ of physical memory]

Ian, good point, will do.

Exactly where is that magical PAE memory supposed to appear?

It'll only "appear" in apps that explicitly code to support the AWE (address windowing extensions) API, which makes use of the PAE extensions in the CPU. I don't think the base OS does this, but applications might.

When I go into the bios, it tells me that there is 4GB installed but only 3.38 Avail for use [and I am running a 64-bit OS]

As Ian pointed out, this is due to the BIOS; check your BIOS for an option that remaps IO memory above 4GB.

Jeff Atwood on March 9, 2007 10:04 AM

18,446,744,073,709,551K of RAM ought to be enough for anybody.

Bill Gates on March 9, 2007 10:11 AM

Well, you guys keep worrying about your need for 4GB RAM. Personally, my max RAM is 512MB, and since I run Linux, not WinDoZe, my systems run the latest software just fine with between 256 and 512MB RAM. My older Dell P3/Xeon can have 2GB RAM, but I only have 512MB, and even tho I looked at upgrading, I can't see the point. My newer Dell Xeon 2.67Ghz only has 256MB RAM, and only because I had to use 2 sticks for the dual channel memory speed. It's a server without even a GUI, so again, why do I need 4GB RAM? Oh yeah, you guys run that spy-ware, ad-ware, virus infested, buggy, full of holes and backdoors thing called WinDoZe. Well, like SpongeBob said to Plankton: Good luck with that!

I'll stick with my Linux......

Larry on March 9, 2007 10:11 AM

Not really knowing what the 32-bit Windows can or can not do, probably it does not know how to use memory at above 4 GB physical address, and you are stuck to 3 GB plus some. (Which for a salvaged memory is not too expensive..)

My current home computer is ASUS A8N-SLI Deluxe with AMD X2 (stepping 02) processor, and it definitely can use all 4 GB of installed memory.
However original BIOS didn't setup the "memory hoisting" correctly, and the end result was rather horrible crash if I tried to "hoist" and to use the memory above that limit. Then very recently there came out a new BIOS release that did it correct, and I am happy big memory spender...

So, if the motherboard BIOS setup has "memory hoisting" buried somewhere in the advanced menus, turning it on may help - or maybe not.
Then running your 32-bit operating system with /PAE enabled may let your operating system to use all 4 GB, permitting more big programs to run simultaneously without resorting to swapping.

By the way, for performance reasons I do prefer to run 64-bit operating systems, and 32-bit applications.
This is equally true for SPARCs running Solaris, as well as PC hardware running whatever.
Very few applications do benefit from 64-bit pointers, but operating system core is usually a different story, especially if you do have more memory than fits inside the first 4 GB.

Matti Aarnio on March 9, 2007 10:31 AM

the real problem is that everybody keeps just going bigger with memory, meanwhile memory access time is only getting slower, not faster, instead of focusing efforts on speeding up processing power someone needs to get on top of that memory speed curve and push the limits a bit, if you could double your memory access speed you could exponentially increase the available address space for total memory because you could double-clock memory accesses. there are lots of smaller and single-purpose sdram chips that do this already, currently i'm using one because i'm designing an FPGA system with limited I/O pins and i'm sending video frames through ethernet from a submarine to a console. granted it's much more feasible because my FPGA's clocking at 50 MHz, so double-clocking the 133 MHz sdram isn't a problem, but still...anyone who wants to set a market trend, there's your place.

Ryan on March 9, 2007 10:43 AM

Maybe all programs in near future comes in a usb-memory-like device that holds its own memory usage? Even its own cpu.. Would be nice.

Moving memory handling to the program instead of bios/OS.. Every program runs in its own world (virtual machine) with pipelines in and out to communicate with the host OS.
The real machines memory mapping will be to handle those pipes.

Stefan on March 9, 2007 11:13 AM

Moral of the story buy AMD? j/k

ryan on March 9, 2007 11:27 AM

Yeah, why mess with Windows when there are dozens of Linux distros with thousands of precompiled packages for the x64 architecture?

D on March 9, 2007 11:35 AM

the behavior of the PAE switch on workstation versions of Windows changed beginning with SP2 for XP. Too many drivers were choking when handed addresses outside the 32-bit address range limit and MS was tired of being blamed for the resulting problems, so in SP2 they removed the portion of the PAE switch's behavior that remapped otherwise-inaccessible RAM below the 4G boundary to above the boundary.

john on March 9, 2007 11:39 AM

"Linux?"

umm Linux has the EXACT SAME PROBLEM so I'm not sure what this is in reference to. This is purely a hardware issue and has nothing to do with the OS. It is so funny to see how many people have absolutely zero idea how their system works... but are quick to recommend things like Linux to fix the problem rofl.

Joe on March 9, 2007 11:41 AM

Old information.

Kalibr on March 9, 2007 11:51 AM

Reminds me of my first 60 GB hard drive.

Took me a while to realize why I was trashing the FAT table/drive every time I wrote beyond 32GB.

engtech on March 9, 2007 11:56 AM

Why doesn't 32-bit Windows support PAE correctly?

Here's linux:

Linux 2.4.x does support greater then 4GB of physical memory (ie. RAM)

It does this by supporting Intel's PAE (Physical Address Extension) features which are in all Pentium Pro and newer CPU's.

It does this via indirect pointers to the higher memory locations, so there is a CPU and RAM hit for using this.

Benchmarks seem to indicated around 3-6% CPU hit just for using the PAE extensions (ie. it applies regardless of whether you are actually accessing memory locations greater then 4GB).

The PAE extensions allow up to a maximum of 64GB of physical memory that the CPU (not a process) can address.

PAE does not increase Linux's ability for *single* processes to see greater then 3GB of RAM (see below).

Escape75 on March 9, 2007 12:03 PM

What about dual channel mode? I have to be honest that I'm not exactly what the requirements for dual channel mode are, but would going 2x1GB and 2x512MB work properly with dual channel mode? Each channel would have 1x1GB and 1x512, so it seems like it should work...

Adam on March 9, 2007 12:04 PM

Windows XP will use 4 GB, but you have to do some tuning. You can do this as described in some Microsoft articles. Here is an example: http://support.microsoft.com/kb/291988.

My understanding is that this will allow it use "most" of it, but even then, it may appear in XP as less then 4 GB... even though it is indeed using it for "most" software applications.

Raedyn on March 9, 2007 12:15 PM

First it was the hard drive size in Windows 98, and now RAM. Microsoft doesn't plan far enough ahead.

Raedyn on March 9, 2007 12:16 PM

Joe: this problem does NOT exist on Linux. It's been many years since this problem was fixed in the Linux kernel. With Linux you can use at least 8GB of RAM (I believe it's 16GB, but not sure) on a 32bit architecture. And no, applications don't need to specifically support it or any of that crap. It just works right out of the box, without you having to mess with it.
So this _IS_ in fact a Windows problem. Sure, it's caused because of the architecture's 32bitness, but other OS's have worked around this for a long time.

Ludo on March 9, 2007 12:23 PM

I run Vista 64 RTM as my *primary* OS. Not in a VM, but on my Dimension 9200 with 4 GB of RAM. I must say that I am very impressed with the driver support on it. Everything works, from my GeForce 7900GS (some major glitches with the driver right after RTM, but they've been fixed now) to my soundcard (a C-Media... -- though it can't pipe mike/line-in sound directly to my speakers... WTF...).

I've had a lot of iTunes crashes (until 7.1 came out, that fixed the problem) and VMWare Server still isn't supported on my platform at all (though that's a Vista thing I believe, not a Vista 64 thing). 32 bit apps run great (you'd never know they weren't 64-bit), with the exception that Visual Studio.NET 2005 can't do edit and continue on 64-bit apps (wtf?).

Other compatibility issues: some browser plugins (Flash, I'm looking in your general direction) aren't compatible with IE7 64-bit, so I have to use IE7 in 32-bit mode most of the time. Not a big deal, though.

What I was most surprised at was the memory utilization. ALMOST ALL OF THE TIME, NO MATTER WHAT I AM DOING, over 2GB of RAM is used. I chalk a lot of this up to SuperFetch. And I must say that SuperFetch uses the memory WELL. Apps launch incredibly fast. VS.NET 2005 comes up (even with the .NET 3.0 CTP designers all installed) in about a second. So far, I've been extremely pleased. And yes, for a developer, 4+GB on a desktop with Vista is definitely worth it (especially if you also consider that apps intrinsically use more memory if they're 64-bit native).

David Markle on March 9, 2007 12:24 PM

that is why i work on a mac. the g5 for the past 4 years gave us 64-bit memory space, worked great for us video editors, and there is no fall out between a 64-bit Mac OS X and a 32-bit. Acutally there is all this talk about dual binary (intel. ppc) for the past year but apple has been doing this since they had the G5 out there, 64-bit or 32-bit. now with the intel core duo 2s people can use more then 4GB of Ram.. 64-bit CUP and all

cheers

rob on March 9, 2007 12:42 PM

Brandon: seriously, when you're claiming the Mac is "behind the times technology-wise", you're making a total fool out of yourself (and no, I'm not a mac fanboy - I don't even own one).

Ludo on March 9, 2007 12:45 PM

The effect of using the PAE switch on 32 OSs is NOT uniform based on how many cpu's are in place. I've seen 1gb or less allocated to the OS and the remainder available for application use. When you expand beyound a single cpu, the partitioning of memory is not uniform either
the scheduler is very actively trying to spread out the load across multiple CPU's. ... Also PAE induces a translation table which degrades performance versus direct access. Memory above 4gb can only be used for db buffer space.

kev on March 9, 2007 12:57 PM

If we were all using DEC/Compaq/HP Alpha Processors invented
by Digital Equipment Corp and runs Windows NT 64, Linux, Tru64 Unix,
VMS, etc this discussion would be moot. The Alpha world was done
clean as 64bits from the ground up, 64 bit cpu registers, cache, and
memory, file system, etc etc. Intel stole proprietary info about
the Alpha from DEC, got caught, and guess what the punishment was?
They had to make Alpha chips for DEC at LOW cost for several years
in a brand new foundry. The Alpha processor (now hanging on only by
the virtue of the endless popularity and reliability of VMS which
everything from Blockbuster Video to Wall Street to hospital systems
to .....;) is pretty much the only exciting thing to happen in hardware
IT since the VAX which was the most exciting thing since the PDP-11.
Oh well, we always take a step forward and then take 2 back and we
have Intel to blame. You'd think they would have learned *something*
from what they stole about Alpha's internals but no, we get the
Itanium and Itanium 2 abominations. All because everyone wants to
run ancient software FOREVER.

Bob Eckert on March 10, 2007 1:00 AM

An interesting article. Thanks.

I still don't own any computers with more than 512MB of ram, but me and my friend were arguing the possible benefits or myths of a 64-bit operating system just two days ago. This was very interesting.

TopHat Stuff on March 10, 2007 2:22 AM

What's worse is that you've got a 64-bit processor (hey, wouldn't that cover the 4GB's of RAM) and you're only running a 32-bit OS. Get a 64-bit OS and get rid of the problem, no hardware upgrade necessary.

Gabriel Smolnycki on March 10, 2007 4:38 AM

Why are you running 32-bit Windows on a 64-bit machine anyways?

Gabriel Smolnycki on March 10, 2007 4:44 AM

For those claiming that 32-bit flash will not work with 64-bit Firefox, do a search for "nspluginwrapper". I have it loaded, and I can view any flash site in 64-bit Firefox 2.0.0.1 (on Linux).

Hmm, seems like it'll only work on *nix platforms at the moment. Here's the link if you're a 64-bit Linux user and want to try this

http://gwenole.beauchesne.info/projects/nspluginwrapper/

Also check your distro, they may have this available as a package (Gentoo did).

Foxbat on March 10, 2007 5:07 AM

In the interest of correcting the inaccurate information posted in this thread.


Physical Address Extensions (PAE)
Every IA32 processor since the Pentium Pro has had PAE36 allowing 64GB of memory to be physically addressed. Most AMD64/EMT64 processors have PAE40 allowing 1TB to be physically addressed however I believe the early 64bit P4s didn't.

Cacheable Area.
On many processors the address space cacheable by the processor, and therefore practically usable is less than the size of the address space. For example the old Slot 1 Celerons could only cache 512MB and PII era Slot 1 CPUs could only cache 4GB. Having a 64GB cacheable area starting in the Xeon line and migrated down.


PAE OS Support
A poster further up was correct that a 32 bit OS cannot address more than 4GB. Address is the key word here it means that each process cannot have no more than 4GB of virtual address space. Nothing says that has to map onto physical RAM below 4GB. However the original poster was correct in that device memory must be below 4GB.

Microsoft artificially limited desktop versions of Windows to only support 4GB of physical address space probably due to the issues with device driver quality. However some server versions can address more, Microsoft can very tightly control what device drivers run on systems running these versions of Windows and therefore allow the PAE suport code to be switched on.

Windows 2000 Advance Server - 8GB Physical
Windows 2000 DataCentre - 32GB Physical
Windows Server 2003 Enterprise - 32GB Physical
Windows Server 2003 DataCentre - 64GB Physical

All other versions of Windows including Windows Vista do not have the PAE code enabled and cannot access memory which has been relocated above 4GB in order to make room for device memory.

Every version of Linux since the early 2.6 kernels has supported 64GB assuming the kernel was configured for it.

Chipset Support.
Even if the OS and the CPU support PAE it still might not be possible to map the physical RAM that has had to be moved to make space for the device memory above 4GB so it can be used. Chipset support is required to make this magic happen and, especially on laptop and "value" segment chipsets this magic is not present. This is the reason the MacBook Pro cannot support more than 3GB of physical RAM but the Mac Pro (based on Xeon processors and chipsets) can.

Address Window Extensions
This is a Windows API to allow a 32 bit process to address memory outside it's 4GB virtual address space. It works by remapping memory below the 4GB barrier. It's a horrible slow hack and never really caught on. MS did it because they needed it internally for things like the 32 bit version of SQL Server and Exchange.


AMD64/EMT64
As noted above processors implementing a 64 bit x86 instruction can address 40 bits or 1TB of RAM. A 32 bit program running under a 64 bit OS can still only use 4GB of virtual address space, where as a 64 bit program can use 64GB of virtual address space. The machine is therefore capable of physically addressing less memory than the programs running on it can virtually address.

Both MacOS and Linux support running both 32 and 64 bit binaries on a 64 bit kernel with no slow down.

Windows cannot do this and requires and emulated 32 bit subsystem called WOW (Windows on Windows) which incurs a slow down. Exactly the same was done with the transition from 16 to 32 bit Windows, in that case having a 16 bit emulated system on 32 bit Windows.

Real Big Iron processors such as POWER, Alpha generally have 48 or 50 odd bits of physical address space. In fact when the Alpha was being designed a customer complained that the processsor couldn't do 64 bit physical addressing. DEC replied that if the customer was willing or order enough RAM from DEC to require the physical address space DEC would redesign the processor to support it :)


To sum up

A good idea (PAE) was hamstrung in the consumer market by lacklustre OS support from Microsoft leading to supporting hardware not being designed to be compatible with it and driver support being broken.

PAE did extremely well in the server market due to rapid OS support via Linux and the ability for third parties to fix broken drivers in this OS. As it was in constant use supporting chipsets were designed and qualified to support it. Microsoft also eventually supported it in the server market but attempted to charge a premium for it.

Chelgrian on March 10, 2007 6:30 AM

PL - you asked "what 64 bit chipset uses 32 bit addressing ? That is by definition not a 64 bit chipset then"

Plenty of systems ship 64-bit processors with 32-bit chipsets. So you're asking the wrong question. You're right that no 64-bit chipsets use 32-bit addressing. But that doesn't stop vendors wiring a 64-bit CPU into a 32-bit chipset. (In just the same way that the presence of a 36-bit address bus on most of the CPUs Intel has shipped since the Pentium Pro hasn't stopped vendors only providing 32-bit addressing in the chipsets.)

Matti - you said "Not really knowing what the 32-bit Windows can or can not do, probably it does not know how to use memory at above 4 GB physical address,". Not true. You've been able to use more than 4GB on 32-bit versions of the server versions of Windows for years. (Although not all editions supported it.) It was possible even back on Windows 2000. (Maybe even NT 4 - I can't remember exactly when they brought in this support.)

Incidentally, the 'double buffering' DMA issue has been with Windows since NT 3.1 - I know this because I used to write device drivers for NT back then... You had to do it for the various RISC systems (Alpha, MIPS, PPC) because most of those systems did something completely different from the x86: the physical addresses seen by the CPU were, in general, not the same as the physical addresses presented on the peripheral buses like PCI. They had a mapping layer in there of exactly the same kind that you need for a 32-bit PCI device to be able to DMA into a 64-bit address space. Drivers are supposed to use the APIs that work with this mapping layer on *all* hardware. (The exact details of the mapping layer, and whether it was even present, were dealt with by the HAL - the Hardware Abstraction Layer. On typical pre-PAE x86 hardware, the HAL would provide a 'do-nothing' mapping layer.)

Device drivers that are written correctly should just work - you don't need to do anything different to enable a device on a 32-bit bus to DMA into the higher ranges of a 64-bit physical address space. The Windows NT memory APIs have supported the necessary mechanisms since day 1, and a driver written back in, say, 1995 that used the APIs correctly should work today with 4GB on a /PAE-enabled system.

However, lazy device driver writers may have noticed that the relevant APIs for mapping from CPU physical addresses to bus-specific physical addresses are always a NOP on 32-bit x86 systems, as are the APIs for creating DMA mapping ranges. So if they decide not to bother calling the appropriate APIs those drivers will stop working when you enable /PAE. This has never been 'correct' - it's in clear violation of what the documentation tells you to do. However, it happens to work on the vast majority of x86 systems, so you just know there will be some drivers out there that do this. (I would hope that any that have been through the WHQL certification won't have this problem, but loads of drivers aren't certified.)

My understanding is that this is the issue that makes /PAE a potential non-starter even where your motherboard happens to support it. The reason switching to a 64-bit OS makes this a non-problem is that the driver writer will have had no option but to write the driver correctly, whereas if you're using 32-bit drivers, you have to hope that it was written correctly. And there are a lot of crappy drivers out there.

Ian Griffiths on March 10, 2007 8:29 AM

I have read the posts and most if not all is way above me. But is there a consensus about how much RAM the average user should get? So if I a person buys a PC or makes one, and plans on using Vista 32, they only should invest in 3 gigs of memory because anything over that won't be seen without some workarounds. Is this right?

Spike on March 10, 2007 10:46 AM

If anyone is interested, I managed to get the FULL 4GB to get recognized on my machine. Its an A8N32-SLI Deluxe and previously was only getting about 3.3GB.

1. Update bios to v1303.
2. Enable Memory Hole. (This is Important!!)

I also disabled the serial parallel port and a few other things but I'm pretty sure thats not of much concern.

Cheers.

Sushant Bhatia on March 10, 2007 12:16 PM

Thank you for the clarification. So the most common Windows versions (XP and Vista) actually don't support PAE to access RAM beyond the 4 GB limit, due to concerns about driver compatibility.

That explains why I only see 2 GB under XP when telling my BIOS to remap memory around the PCI "hole", even though Memtest can see all 4 GB. So PAE is really a nonstarter for most readers of this blog.

Chris Nahr on March 11, 2007 4:57 AM

xp and vista is no god I personaly stick whit my win 2003 server

i have sql servers whith 16 G of ram

but a guy from microsft told me that 2003 server will not work whith more then 20G of ram i have a server where ai can plug 120G of ram :D

victor on March 11, 2007 6:03 AM

This is confusing. Even the "sum up" has a few points wrong.

Enabling "PAE" means that an extra level of page tables gets used. This leads to the following changes:

- One extra level is added to the page table lookup. This can possibly make memory address slower, but usually the difference is not noticeable since the lookup is cached in TLBs.

- Data Execution Protection (DEP) is possible. Adding the extra level of page tables frees up a few bits in the page table descriptor. One of these newly freed bits is now used to mark a page as not-executable.

- Access to up to 16 GB of physical memory is possible.

- Some kernel pointers are now 64 bits.

So if you enable PAE, and your motherboard actually connects at least 33 address pins from the CPU to the memory, and your BIOS supports memory remapping, you should be able to get a full 4 GB of RAM, right?

Nope. Not if you have XP SP2 or Vista, anyway.

Notice that part about kernel pointers being 64 bits. A whole bunch of drivers don't handle that correctly. So as of XP SP2 (also in Vista), even in PAE mode, pointers are limited to 32 bits. Even though the OS and the hardware is fully capable of working with more memory, the OS never touches anything above the 4GB boundary. This was a conscious decision. Stability of the system was considered more important than access to the extra physical memory.

Doug on March 11, 2007 7:18 AM

"Dude .. you ate my ******* schnitzel!!!" :)

Nice post. I started my Vista usage with an x64 version but caved in and reverted to 32 Bit due to lack of software, and drivers. It's gonna get better ... but were not there yet.

Lars on March 12, 2007 2:54 AM

More comments»

The comments to this entry are closed.