Solved

32-bit App with LARGEADDRESSAWARE running on Win7-64

Posted on 2012-03-20
9
370 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Using YubiKey with REST API application 2 82
mapBully challenge 6 92
topping1 challenge 7 53
control image tags in a string ? 12 68
This article will show, step by step, how to integrate R code into a R Sweave document
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

747 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