How to enable LARGEADDRESSAWARE?

The command to enable large address aware is as follows…

EditBin /LARGEADDRESSAWARE NotePad.exe

How to check if the above command worked or not? Run the above executable (in our case NotePad.exe) with DumpBin.exe.

C:> DumpBin /Headers NotePad.exe

FILE HEADER VALUES
             14C machine (x86)
               4 number of sections
        4BA1DC16 time date stamp Thu Mar 18 02:53:58 2010
               0 file pointer to symbol table
               0 number of symbols
              E0 size of optional header
             122 characteristics
                   Executable
Application can handle large (>2GB) addresses
                   32 bit word machine

See highlighted line.

2 thoughts on “How to enable LARGEADDRESSAWARE?

  1. Hi Nibu,

    One doubt, what was the purpose of having the LARGEADDRESSAWARE flag in a 32 bit environment. No matter the flag is specified or not, in a 32 bit process, the pointers will be capable of handling 2^32 addresses right? But of course the upper 2B is reserved for kernel. Are you saying that even if I start the OS with /3GB switch, my application cannot use the memory after 2GB unless this flag is specified?

    • Hi Naveen,

      >> One doubt, what was the purpose of having the LARGEADDRESSAWARE flag in a 32 bit environment. No matter the flag is specified or not, in a 32 bit process, the pointers will be capable of
      >> handling 2^32 addresses right?
      LARGEADDRESSAWARE enables an application to use 3GB memory which is within limits of 2^32 (4GB).

      >> Are you saying that even if I start the OS with /3GB switch, my application cannot use the memory after 2GB unless this flag is specified?
      The flag tells the OS to increase user mode address space by 1 GB and make it 3GB and make kernel mode 1 GB, but this can cause issues with applications which hasn’t ‘requested’ for a larger address space. Hence the designers chose to allow only those applications to see the extra 1GB space which has requested for the extra space. So how to request for this space: via LARGEADDRESSAWARE flag which in turn adds IMAGE_FILE_LARGE_ADDRESS_AWARE to the image header.

      So what happens to the applications which hasn’t requested the extra 1GB space? They continue to use 2GB, the 1GB remains invisible to the app, which means the memory is wasted. Why is it wasted? Neither kernel nor the user mode app is using it.

      LARGEADDRESSAWARE and /3GB work in tandem. Its good for server machines which run SQL server or other heavy apps. Sometimes good with Visual Studio which loads a huge number of projects.
      Thank you,
      Nibu

Appreciate your comments...