Virtual Alloc stops at 1.8gb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DreamU
    New Member
    • Jul 2008
    • 6

    Virtual Alloc stops at 1.8gb

    In an effort to understanding game behavior I have written a simple 10 line program which just calls VirtualAlloc (100mb each time) until it fails to allocate more memory. It always stops at 1.8gb as confirmed by the Virtual Size display in procexp.exe.

    I was expecting more, at least 2gb for starters. But I have linked with /LargeAddressAwa re and used bcdedit (the so called /3gb switch) to increase the program space to 2.3gb. Hence, I don't understand why it would stop at 1.8gb.

    I am running Visual C++ Express (2008) under Vista SP1.
  • DreamU
    New Member
    • Jul 2008
    • 6

    #2
    OK, think I have a partial answer. When VirtualAlloc stopped I reduced the request size from 100mb to 50mb and then 25mb in which case it did indeed allocate Virtual Memory up to 2gb. Hence, fragmentation caused it to stop at 1.8gb.

    Now GlobalMemorySta tus reports my Virtual Memory as 2.14gb. Does anyone have any insight into why bcdedit (and /LargeAddressAwa re) is not giving me the 2304mb which I set it to?

    Comment

    • DreamU
      New Member
      • Jul 2008
      • 6

      #3
      Bah, rookie mistake, I double checked my linker options and for some reason 'Enable Large Addresses' (/LargeAddressAwa re) was not set. I remember setting it yesterday but should have checked it before posting. So, with that option set I now get 2.3gb of virtual memory allocated - just as I expected.

      Comment

      Working...