Allocation of large memblock unexplainably fails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dzenanz
    New Member
    • Feb 2008
    • 45

    Allocation of large memblock unexplainably fails

    Hello!

    In a certain function i have a line
    Code:
    m_pBuffer = new double[512*512*736]; //~1.5GB
    the allocation fails here. At that time, process' virtual memory size is 380MB (information obtained using task manager), and there is over 2GB of free RAM.

    WinXP SP3 32-bit, same thing happens with VS2005 and VS2008.

    I have tried setting "Support Addresses Larger Than 2 Gigabytes (/LARGEADDRESSAWA RE)". It has no effect.

    If I use /HEAP:reserve, and set the size to 1.5GB or more, then other allocation (368MB), which comes before this big one, fails.

    Do you have some ideas what is causing this, and perhaps suggestions how to overcome this problem?

    How much effect would have to try this on 64-bit machine?

    Dženan
  • newb16
    Contributor
    • Jul 2008
    • 687

    #2
    Does GetProcessHeap( )+HeapAlloc() with same amount work? I think it's worth trying on 64-bit machine.

    Comment

    Working...