How to make MFC apps use less RAM?
-
Are there any optimization options (or compiler switches) that would decrease amount of memory required by Release build of MFC apps? I know that memory consumption should be the least concern in these days, but I have small SystemTray app., and it eats quite a bit of RAM. The answer to my problem is to *not* use MFC to write SystemTray application, but writing in C++, would seem bit barbaric. If there are no optimization options or compiler switches to minimize memory consumption, is there a method that at least would tell Windows OS to use *page file*, while the program is inactive? thanks in advance Mike
-
Are there any optimization options (or compiler switches) that would decrease amount of memory required by Release build of MFC apps? I know that memory consumption should be the least concern in these days, but I have small SystemTray app., and it eats quite a bit of RAM. The answer to my problem is to *not* use MFC to write SystemTray application, but writing in C++, would seem bit barbaric. If there are no optimization options or compiler switches to minimize memory consumption, is there a method that at least would tell Windows OS to use *page file*, while the program is inactive? thanks in advance Mike
Starting at the end, you don't have to *tell* windows to use the page file, it will do so on it's own; not sure what algorithm it uses to determine what blocks to swap out, but i'm sure as long as your program is sitting quietly, it will Do The Right Thing. :) If you want to try using something other than MFC, ATL+WTL sounds like it might be a good choice. Don't use it myself though, so can't say for sure. Finally, a quick-and-easy way to go would be to compile using MFC as a shared library, and use some of the tips given in these articles: http://www.codeproject.com/tips/reducesixeexe.asp http://www.codeproject.com/tips/aggressiveoptimize.asp And if words were wisdom, I'd be talking even more.
The Offspring, I Choose