I have Vista 64 Ultimate and installed the latest Qt SDK, 2009.03. I seem to be hitting memory limits when using malloc() even though I have 8GB of physical RAM, and task manager shows only 2GB of it is used. My program crashes when I try to allocate large amounts of memory.
The exact limit seems to vary, but it seems to be about 1.74GB. The following code causes my program to crash:
#include <iostream>
#include <qglobal.h>
using namespace std;
int main(int argc, char *argv[]){
double* test = (double*) malloc(1863000000);
cout<<"Test"<<endl;
test[0] = 1.0;
}
#include <iostream>
#include <qglobal.h>
using namespace std;
int main(int argc, char *argv[]){
double* test = (double*) malloc(1863000000);
cout<<"Test"<<endl;
test[0] = 1.0;
}
To copy to clipboard, switch view to plain text mode
With a slightly smaller number the program executes properly. I don't think Vista Ultimate has a memory limit for processes. Is the latest Qt compiler 64-bit?
How can I utilize my RAM to its fullest extent using malloc() and Qt?
Bookmarks