32 Bit Applications on a 64 Bit OS

Other than memory size limits of 4GB, what is the penalty for running 32 bit applications on an OS running in 64 bit? For example. does a 32 bit application require that it's address space be allocated within the first 4 GB or does the OS and processor abstract this away from the application?

There has been a lot of push for 64 bit applications in the software community where I don't always foresee the applications requiring such a large amount of memory (e.g, Firefox), so I'm just curious of the benefits and pitfalls of running 32 bit applications on a 64 bit platform.


Solution 1:

Do a google for "russinovich pushing limits" and you'll find a series of articles penned by the author of the sysinternals suite of tools for Windows on various aspects of memory usage by Windows.

I'm not sure there really are a lot of significant drawbacks to running 32 bit applications on a 64 bit OS. The biggest bonuses to running 64 on 64 are memory addressing and...that's a big one.

Even the latest version of OS X defaults to 32 bit (you hit 6 and 4 at bootup to start the 64 bit kernel, but you won't get all the kernel extensions to work properly as I recall). OS X has been a "mixed" OS for quite awhile.

The only drawbacks I've heard that impact people with 64 bit OS's involves drivers (some 32 bit drivers not working properly) and older machines not liking a 64 bit OS if the processor doesn't support it, and there's still a lot of older machines out there.

Solution 2:

It's up to the developer to ensure that it works correctly since some things that need hooks to the 64-bit OS need to be accounted for. However, many applications work great on a 64-bit OS.

As a general principle, if your server's memory is 4GB or greater, going with 64-bit is the way to go. Even IIS is recommended by Microsoft to run 64-bit OS with 32-bit app pools (or IIS as a whole in 32-bit mode on WS03).

64-bit apps have more memory overhead which is one of the main things preventing a full move to 64-bit. Also, some applications don't perform as well on 64-bit. For example, ASP.NET does better in 32-bit app pools on a web server.

As far as any limits on the memory it can use, that's not a concern. The 64-bit OS breaks those boundaries and the 32-bit apps benefit.

Solution 3:

If your application will never use over 4GB of memory, there's no real advantage to having a 64 bit version. That said, most people with 64 bit O/S's want a 64 bit version of everything ... even if they don't need it.

Solution 4:

The OS abstracts away where the memory comes from, it doesn't need to be the physically first 4Gbs.

One other penalty of running 32 bit app on a 64 bit OS is that app now needs to load a bunch of 32 bit dlls, and increase the memory usage on your machine.

dlls - atleast the code section - are shared among all applications that uses that dll in most cases. Your running 64 bit apps as well as the windows components itself will load and share the standard 64 dlls. When you start the first 32 bit app it'll need to load the 32 bit version of those dlls.