<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt">Or, just restructure your program to be multi-process so each process has 3gb available to it.<br>Which is a great approach if you have virtual memory. But I don't.<br><div><span><br></span></div><div><br></div>  <div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Alex Malyushytskyy <alexmalvtk@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> interest@qt-project.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, August 20, 2012 6:27 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Interest] memory fragmentation?<br>
 </font> </div> <br>
>>Nonsense. Any application using a gigabyte or more of memory should HAVE<br>SWITCHED to 64-bit a couple of years ago.<br><br>It is not nonsense.<br>You provide to users version which works on their system (whatever they have).<br><br>And even though application may need close to 2GB of data (or more) to<br>work efficiently,<br>it does not mean that it can't be run on 32 bit computers to solve<br>reasonable problems there.<br>It does not mean that you can't recommend user to use 64 bit version<br>of the code.<br>You have to make sure your application either handles all the tasks<br>correctly, be efficient if possible,<br>or at least it has to notify user that specific task can't be handled<br>on this specific system as early as possible.<br><br>Crashing or even exiting due to insufficient memory in the middle of<br>long term task is not a choice.<br><br>>> What can be done to combat this in C++/Qt?<br><br>As it was said above you can control
 memory allocation yourself, up to<br>the point you can write your own garbage collector.<br>All applications I know which are designed to work with huge amount of<br>memory (especially large than available RAM) are utilizing its own<br>memory handling.<br>System due to generality normally is too inefficient for your specific case.<br><br>For example one of our application on Windows ( this is the case when<br>Windows is more flexible than Linux)<br><br> - reserves  the largest amount of continues memory we could afford<br>for data (leaving enough for your widgets ) using VirtualAlloc with<br>MEM_RESERVE flag,<br>This insures that this address range will not be used when regular<br>memory allocation occurs.<br><br>- When data is loaded VirtualAlloc is called with MEM_COMMIT flag to<br>allocate as much memory as needed.<br>This approach works well since reservation takes no time, time<br>consuming operation is (normally associated with memory
 allocations)<br>committing.<br><br>Unfortunately it is way too difficult to give good advice without<br>knowing application details.<br><br>Regards,<br>  Alex<br>_______________________________________________<br>Interest mailing list<br><a ymailto="mailto:Interest@qt-project.org" href="mailto:Interest@qt-project.org">Interest@qt-project.org</a><br>http://lists.qt-project.org/mailman/listinfo/interest<br><br><br> </div> </div>  </div></body></html>