Click here to Skip to main content
15,667,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have a 32 bit windows application deveoped in VS 2005 .NET 2.0 , it was failing with memory exception on reacing 1.3 GB , I enabled LARGEADDRESSAWARE flag on windows7 application worked fine till 2.1 GB .

I didnt find much info online for Windows Server 2003 SP2 standard edition .

Will the exe with flag set work or any changes required in boot.ini file to set upto max 4 GB ?

Please suggest if you have any idea / faced this issue earlier.

Thanks in Advance.

Ron Beyer 4-Oct-13 17:25pm    
Out of curiousity, what are you doing that requires > 1gb of RAM for a single application instance?
Sergey Alexandrovich Kryukov 4-Oct-13 17:39pm    
I understand your curiosity. Too often, such things result from overly simplified architecture, if not plain sloppiness.
I tried to answer. Will you check up if I remember related Windows facts correctly?
Thank you.
srastogi85 4-Oct-13 17:44pm    
Sergey i debugged it through redgate memory profiler it showed memory consumed in unmanaged code , then used debugDiag to identigy libs it identify Widowscodes.dll and mscorworks.dll , so
i made app LARGEADDRESSAWARE to make it work part this file issue as otheroperations can be performed. debugDiag didnt identified leaks in code dlls , thats the issue
Sergey Alexandrovich Kryukov 4-Oct-13 17:48pm    
Well, then the question is what did you do with unmanaged code and why. Please see my advice below and in my answer.
Sergey Alexandrovich Kryukov 4-Oct-13 17:43pm    
OP tried to answer you, please see below, with my comment...

1 solution

As you should understand, Win32 addressable space is only 4Gb, but, on 32-bit OS versions, it is limited to only 2Gb (the rest is reserved by OS), and can be extended to 3. On 64-bit versions, a 32-bit application is executed under WoW64:[^].

In case of WoW64, your application can get up to 4Gb.

But that's not all. I'm not sure if you are calculating your memory usage correctly. (And no, you should not rely on the Task Manager.) You may count the memory you take for some data object(s) you use, but this is not all memory you need. Simply enough, if you have not enough memory, you just don't have enough. OS is not trying to full you around and hide some valuable memory under the hood. You should either think of migrating to 64-bit architectures or limit your memory consumption by refining your architecture or keeping part of data on the disk.


I learned that you have been using a memory profiler later, after I posted this answer. Well, very good…

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900