0

when using the LARGEADDRESSAWARE flag, can my 32bit program access 4GB of address space, or only 3GB of address space? why?

Aviad Rozenhek
  • 2,259
  • 3
  • 21
  • 42

4 Answers4

3

A 32 bit process with LARGEADDRESSAWARE set can address 4GB on 64 bit Windows. It can do so because that's how the wonderful engineers at Microsoft implemented it.

It's documented here.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • from the link: Virtual address space per 32-bit process: 2 GB, 4 GB if the application is compiled with the /LARGEADDRESSAWARE switch – Aviad Rozenhek May 16 '11 at 16:17
2

maybe the anwser is there

A 32 bit process will access 2GB RAM, with the LARGEADDRESSAWARE flag, it reaches the 4GB

Community
  • 1
  • 1
Cédric Julien
  • 78,516
  • 15
  • 127
  • 132
0

In most OSes your 32-bit space is broken up into parts that you're program(user-code) can allocate and use, and sections that the kernel owns. Unless you're writing your own OS/kernel let the system APIs(such as malloc/free, new/delete in C/C++) or the the underlying management in python, java manage the memory allocation for you.

However, if you're getting 'out of memory' errors start to consider

  1. Do I have a leak somewhere? You're not free'ing every pointer you're malloc'ing Wonderous tools such as valgrind can help find those.
  2. Do I need to redesign my program to use less memory? Are you doing things like saving every line of data you read out of a huge file in an array in python or java. Look for stuff you can throw away
Andrew
  • 2,530
  • 16
  • 9