Failed to allocate 1.5 GB of memory in vC ++ mfc application

I have an MFC vC ++ application written in VS2010. When I try to allocate a double array of size 185000000 using

  • malloc: it returns NULL
  • new statement: it throws a CMemoryException

But when I write a standalone win32 console application in C ++, for example:

double *ptr = NULL;
ptr = new double[185000000];

It works great, and the ProcessExplorer application shows ~ 1411 MB of memory.

My MFC application has a graphical interface and a large number of libraries added to work with the Agilent meter and voltage measurement of the NI-6255 meter.

+4
source share
1 answer

All Articles