Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Weird Memory Usage

Weird Memory Usage

Scheduled Pinned Locked Moved C / C++ / MFC
c++performancequestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Hambleton
    wrote on last edited by
    #1

    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)

    T 1 Reply Last reply
    0
    • C Chris Hambleton

      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)

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      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. ***

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups