1

I wrote an application with Qt 4.8.1 and MinGW32 (Nokia Qt SDK). I try to load a large file with this app, but the app always crash when memory usage reach 1,868 MB. If I reduce the size of input file the app works fine. Is there any memory limitations on Qt apps or MinGW32? What should I do if I really want my app to use more memory? My windows is 64 bit.

p.s. Adding "QMAKE_LFLAGS_WINDOWS += -Wl,--stack,32000000" to .pro file won't work

Thanks very much!

p.p.s. I saw many software are capable of using 10+ GB, e.g. Matlab, how to do that on Qt apps?

vvofdcx
  • 509
  • 1
  • 6
  • 20
  • http://stackoverflow.com/questions/5686459/what-is-the-maximum-memory-available-to-a-c-application-on-32-bit-windows – otisonoza Mar 20 '14 at 18:53
  • Generally the way to handle more data than fits to memory is to not load all of it to memory at once. However, if you have that large data, it would be better to switch to 64 bit compiler and perhaps use memory mapped files and not worry about address space. It will make life much easier for you, when OS does the memory management part for you. – hyde Mar 23 '14 at 18:28

2 Answers2

0

Your copy of windows may be 64 bit, but MingW32 is a 32 bit compiler, so any app written with that compiler has all the standard limits inherent to 32 bit Windows. Effectively, you won't be able to get more than around 2G of memory for your app to use.

There's a method to get that up to 3G, but beyond that you need a 64 bit compiler.

Michael Kohne
  • 11,888
  • 3
  • 47
  • 79
0

2GB is limit is for process only. You can spread your application along N processes (32-bit) to allocate N x 2GB. Operating system must still be 64-bit.

slyy2048
  • 315
  • 4
  • 9