Using /LARGEADDRESSAWARE on 64-bit Windows for 32-bit programs


Probably the biggest advantage of 64-bit Windows is not the larger registers but rather the expansive 64-bit address space. Recall that even when the /3GB switch is set, 32-bit programs receive only 2GB of address space unless they indicate their willingness to cope with addresses above 2GB by passing the /LARGEADDRESSAWARE flag.

This flag means the same thing on 64-bit Windows. But since 64-bit Windows has a much larger address space available to it, it can afford to give the 32-bit Windows program the entire 4GB of address space to use. This is mentioned almost incidentally in Knowledge Base article Q889654 in the table "Comparison of memory and CPU limits in the 32-bit and 64-bit versions of Windows".

In other words, certain categories of 32-bit programs (namely, those tight on address space) benefit from running on 64-bit Windows machine, even though they aren't explicitly taking advantage of any 64-bit features.

Comments (11)
  1. Joe Beda says:

    BTW, the new version of photoshop (CS2) is supposedly linked with /LARGEADDRESSAWARE. I haven’t tried it on a machine with lots of RAM yet, but it is supposed to work well.

    http://www.adobe.com/support/techdocs/320005.html

  2. Miles Archer says:

    Dude, you don’t even need a machine with large amounts of ram. You just need data that won’t fit in 3GB and let it swap it out to disk. Of course it will be really slow unless you have a significant amount of real memory available.

  3. What’s to explain? The compiler and your application will run under the Win32 emulator.

  4. martyCZ says:

    From what I remember about memory mapped files, they can be used to "test" your address space well (instead of allocating 3GB on swap).

  5. AC says:

    Wow, full 4 GB address space for one Win32 app, that’s really nice.

    I know it’s a little off topic, but I haven’t seen any page that it explains: if I switch to Windows XP 64, can I still *develop* (maintain) my existing Win32 applications? And from time to time try to develop something for Win64? Has anybody experience on this subject? Any catches?

  6. Dave says:

    "if I switch to Windows XP 64, can I still *develop* (maintain) my existing Win32 applications?"

    The biggest gotcha is that MS Virtual PC/Server won’t run on XP64. That is a showstopper for me. VS2005 SP1 is supposed to let you run on XP64 but I don’t know when it’s coming out. VMWare has beta support for XP64 now I think.

    If you’re not using either of those products, you either have a dozen physical test systems or you’re not testing adequately.

    The upgrade license deal that MS offers is pretty scary, they invalidate your 32-bit license and give you a 64-bit one so you can’t go back. That should encourage users to buy XP64 outright so maybe that’s what was intended. Really, you’re better off with something like the MSDN Subscriptions if you do a lot of dev testing on multiple OS though.

  7. Factory says:

    "VS2005 SP1 is supposed to let you run on XP64 but I don’t know when it’s coming out."

    Erm, VS2005 is still in beta, and we only recently got a SP for VS2002. I wouldn’t hold my breath.. :)

  8. RonO says:

    ""VS2005 SP1 is supposed to let you run on XP64 but I don’t know when it’s coming out."

    Erm, VS2005 is still in beta, and we only recently got a SP for VS2002. I wouldn’t hold my breath.. :) "

    In this context, VS2005 = Virtual Server 2005.

  9. Justin Olbrantz says:

    What exactly needs to be ’emulated’ for running a 32-bit program on a Windows XP 64 system? I got the impression from the x86-64 documentation that running a 32-bit process on a 64-bit OS was a simple affair.

  10. Justin Olbrantz says:

    I’m kinda surprised that the 3 gig-4 gig address space difference exists at all. Wasn’t the point or requiring the /LARGEADDRESSAWARE flag so that apps that expect addresses under 2 gigs won’t break when they get a higher address? Wouldn’t it be the same problem, if a program that’s expecting an address in the lowest 3 gigs suddenly gets one in the highest gig?

  11. Not quite "Riffing on Raymond" but he just wrote about this, and it reminded me of a story that was related…

Comments are closed.