Solved

32-bit App with LARGEADDRESSAWARE running on Win7-64

Posted on 2012-03-20
9
373 Views
Last Modified: 2012-03-20
I have built my 32-bit windows application with the LARGEADDRESSAWARE linker option.  I then run this application on a win7-64bit OS PC.   Watching Task Manager and keeping an eye on peak memory utilization by my application's process, I see that it seems to be able to grab up to "slightly over 3 GB" - the max looks to be something like 3.1GB.  Trying to get more than that I get an "out of memory" error.  I had thought the limit would be 4GB.  Why is it 3.1GB?
Is there a way to get up tp 4GB?
0
Comment
Question by:tullhead
  • 5
  • 4
9 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 37743983
>>I had thought the limit would be 4GB.  Why is it 3.1GB?

The reason is that the system resources take up the remaining address space up to the theorhetical 4GB, in particular the addresses the PCI bus uses and most notably the AGP address space.
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 37743991
0
 

Author Comment

by:tullhead
ID: 37744043
Would my apparent limit ( 3.1 GB ) vary from computer to computer, perhaps due to a different video card in one PC versus another?
0
 
LVL 86

Expert Comment

by:jkr
ID: 37744068
No, not really - at least you won't get the full 4GB. BTW, that was my main reason to ditch W7/32 in favour of W7/64, since that "4GB Physical RAM, 3.xGB usable" simply hurt too much.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:tullhead
ID: 37744107
In my case, I can exist (just barely) in this 3.1GB space -- I am image processing files that are nearly 700 MB in size -- so things are OK.  But I dread it suddenly not working on some PC because on that particular PC, for whatever reason, it can't grab 3.1 GB.

In the meantime, I'm starting my port to 64-bits.
0
 
LVL 86

Expert Comment

by:jkr
ID: 37744129
Um, the usable address space per process is 2GB, you can go up to 3GB by adding '/3GB' to your boot.ini, see http://msdn.microsoft.com/en-us/windows/hardware/gg487508 ("Memory Support and Windows Operating System")

The /3GB switch allocates 3 GB of virtual address space to an application that uses IMAGE_FILE_LARGE_ADDRESS_AWARE in the process header. This switch allows applications to address 1 GB of additional virtual address space above 2 GB.
0
 

Author Comment

by:tullhead
ID: 37744156
This /3GB stuff, as I understand it, applies to running on a 32-bit OS, so that you can get 3GB instead of 2GB.  But in my case, we are happy to run on a 64-bit OS, and get 3.1 GB for this 32-bit app.  We just use the linker option /LARGEADDRESSAWARE and no need to do the /3GB thing.  Correct?
0
 

Author Comment

by:tullhead
ID: 37744161
I think its correct because its working!
0
 
LVL 86

Expert Comment

by:jkr
ID: 37744186
Ah, OK - yet a 32bit process still is limited that way, even when running on WOW64 - yet the '/GB' have no effect there...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now