Weird Memory Usage
-
Hi, I have an MFC app with a web browser in it, and I'm getting some strange memory usage. When I first start up the app, it intially takes ~28 M of memory. When I minimize it, it drops to about 1.6M (which I expected). Then when I restore the app and then start using it, it takes only about 12 M... What's strange is why it initially takes up 28 M of memory, when it really on needs 12M later on.... any ideas what's going on and how I can make it so the app only takes up about 12 M initially? Thanks! "If at any time I announce that a nation or kingdom is to be uprooted, torn down and destroyed, and if that nation I warned repents of its evil, then I will relent and not inflict on it the disaster I had planned. And if at another time I announce that a nation or kingdom is to be built up and planted, and if it does evil in my sight and does not obey me, then I will reconsider the good I had intended to do for it." -- Jeremiah 18:7-10 (God, commenting on the value of the United Nations)
-
Hi, I have an MFC app with a web browser in it, and I'm getting some strange memory usage. When I first start up the app, it intially takes ~28 M of memory. When I minimize it, it drops to about 1.6M (which I expected). Then when I restore the app and then start using it, it takes only about 12 M... What's strange is why it initially takes up 28 M of memory, when it really on needs 12M later on.... any ideas what's going on and how I can make it so the app only takes up about 12 M initially? Thanks! "If at any time I announce that a nation or kingdom is to be uprooted, torn down and destroyed, and if that nation I warned repents of its evil, then I will relent and not inflict on it the disaster I had planned. And if at another time I announce that a nation or kingdom is to be built up and planted, and if it does evil in my sight and does not obey me, then I will reconsider the good I had intended to do for it." -- Jeremiah 18:7-10 (God, commenting on the value of the United Nations)
Windows calls ::SetProcessWorkingSetSize when you minimize applications. You can call this API yourself, but it may hit the performance - your app will generate more page faults. Unless you have bitching customer who spends too much time in Task Manager, it's best to leave this to OS. Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***