Running 32 bit .NET programs on 64 bit Vista

Discussion in 'Windows 64bit' started by segallw@gmail.com, Mar 18, 2008.

  1. Guest

    Hi,

    If I installed 64 bit Vista on a pc with 8GB RAM, do 32 bit programs
    have access to the additional RAM over 3GB (or is it 4GB 32bit
    programs are limited to?).

    For example, on a pc with 8GB physical RAM, say one 32bit program use
    2GB RAM, if Vista has already used 4GB ram, does the 32bit program use
    the next lot of 2GB as though it is the first lot of 2GB or is it
    simply unable to address the memory?

    If this is unclear, I'll put it another way.

    If I have 6 x 32bit programs each using say 1GB of RAM on Vista x64,
    does the operating system assign each 32bit program 1GB RAM and handle
    any memory address issues? I guess being 32bit they're not actually
    capable of addressing memory over 4GB or so?

    Or are all 32bit programs limited to the first 3 or 4 GB RAM on Vista
    x64?

    Thanks
     
    , Mar 18, 2008
    #1
    1. Advertising

  2. You have a basic misunderstanding of RAM, memory, and virtual memory address
    space.

    32-bit Windows uses a flat memory address space, thus is limited to 4 GB of
    memory addresses. This is divided up 2 GB for individual user programs, and
    2 gb for the operating system. It doesn't matter if you have 4 GB of RAM, or
    512 Mb of RAM, it's the same virtual memory address space. This means that
    in order to directly address the memory used by video cards, and other such
    things on your computer, the OS has to be assign those specific addresses to
    that memory, and it's locked away and can't be seen - effectively making
    your memory address space smaller. But each user program that runs gets its
    own 2 GB of virtual memory address space, regardless of the RAM in your
    machine. There are even programs that can access >2 GB of memory address
    space, IF you configure Windows to allow it - using the /3GB boot switch.
    This effectively limits the OS to only 1 GB of virtual memory address space
    for its own operations, however, causing the operating system to effectively
    starve if there's a lot of I/O or other demands on the OS itself, so it
    isn't recommended for ordinary usage. Especially since only specially
    written programs can take advantage of it.

    Now, RAM. If you have 8 GB of RAM, running 32-bit Windows Vista, you simply
    can't see any of the RAM >4GB - there's no address space to communicate with
    it. So, if you have >4GB of RAM, you _need_ 64-bit Windows. (There is one
    exception to this, using something called /PAE, but it's not supported on
    all versions of 32-bit Windows and has a significant speed penalty, so is
    generally not recommended.)

    Whether a particular program that uses 1 GB of _memory_ will have all of the
    program in RAM is a decision that the operating system makes. It may decide
    to offload some of that to virtual memory, or may leave it all in RAM,
    depending on the other requirements of the system.

    In 64-bit Windows, the memory address space is 16 TB. 8TB for user programs
    and 8TB for the operating system. 32-bit programs running in 64-bit Windows
    run in the WOW64 subsystem. Each 32-bit program is assigned a 4 GB virtual
    memory address space in the WOW64 subsystem - with no requirement for the OS
    which is still running in the 8 TB of virtual memory address space it gets.
    So, if your 32-bit program is written to take advantage of >2GB of memory
    (using the LARGEMEMORYADDRESSAWARE compiler switch), it will automatically
    see a full 4GB.

    --
    Charlie.
    http://msmvps.com/xperts64
    http://mvp.support.microsoft.com/profile/charlie.russel


    <> wrote in message
    news:...
    >
    > Hi,
    >
    > If I installed 64 bit Vista on a pc with 8GB RAM, do 32 bit programs
    > have access to the additional RAM over 3GB (or is it 4GB 32bit
    > programs are limited to?).
    >
    > For example, on a pc with 8GB physical RAM, say one 32bit program use
    > 2GB RAM, if Vista has already used 4GB ram, does the 32bit program use
    > the next lot of 2GB as though it is the first lot of 2GB or is it
    > simply unable to address the memory?
    >
    > If this is unclear, I'll put it another way.
    >
    > If I have 6 x 32bit programs each using say 1GB of RAM on Vista x64,
    > does the operating system assign each 32bit program 1GB RAM and handle
    > any memory address issues? I guess being 32bit they're not actually
    > capable of addressing memory over 4GB or so?
    >
    > Or are all 32bit programs limited to the first 3 or 4 GB RAM on Vista
    > x64?
    >
    > Thanks
    >
     
    Charlie Russel - MVP, Mar 18, 2008
    #2
    1. Advertising

  3. Guest

    Thanks Charlie for that thorough explanation.
     
    , Mar 18, 2008
    #3
  4. Doug Forster Guest

    Just to add a tiny bit more to Charlie's thorough explanation, I notice your
    post title mentions .NET programs. If a managed (.NET) program is compiled
    to target any platform (the Visual Studio default) then it will run as a 64
    bit program on a 64 bit OS and a 32 bit program on a 32 bit OS. This is
    achieved by the magic of JIT compilation.

    Cheers
    Doug Forster
     
    Doug Forster, Mar 18, 2008
    #4
  5. Thanks. What happens at the compiler level is entirely outside my area of
    expertise!

    --
    Charlie.
    http://msmvps.com/xperts64
    http://mvp.support.microsoft.com/profile/charlie.russel


    "Doug Forster" <nobody@nowhere,com> wrote in message
    news:%...
    > Just to add a tiny bit more to Charlie's thorough explanation, I notice
    > your post title mentions .NET programs. If a managed (.NET) program is
    > compiled to target any platform (the Visual Studio default) then it will
    > run as a 64 bit program on a 64 bit OS and a 32 bit program on a 32 bit
    > OS. This is achieved by the magic of JIT compilation.
    >
    > Cheers
    > Doug Forster
    >
     
    Charlie Russel - MVP, Mar 19, 2008
    #5
  6. Guest

    I assumed only being able to target 64 bit (together with 32 bit) OS
    only if I compiled on 64 bit OS. I'm not sure why I had that
    assumption.

    I'm compiling on 32 bit OS and need to run my .NET program on both 32
    & 64 bit OS, so that is good news the compiler automatically manages
    the change to 64 bit OS allowing my .NET program access to more RAM.

    Thanks Doug.
     
    , Mar 23, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke O'Malley

    Running 16 bit programs & installs on XP Pro

    Luke O'Malley, Oct 17, 2004, in forum: Computer Support
    Replies:
    1
    Views:
    1,817
    Toolman Tim
    Oct 17, 2004
  2. Edge
    Replies:
    9
    Views:
    486
  3. Replies:
    1
    Views:
    402
    Charlie Russel - MVP
    Jul 22, 2007
  4. =?Utf-8?B?Umljaw==?=

    Running Vista 64 bit in 32 bit mode

    =?Utf-8?B?Umljaw==?=, Oct 8, 2007, in forum: Windows 64bit
    Replies:
    21
    Views:
    1,327
    ssc73
    May 6, 2009
  5. Guest
    Replies:
    9
    Views:
    900
    Guest
    Aug 6, 2009
Loading...

Share This Page