MMC application memory usage keep increasing RRS feed

  • Question


    I wrote a MMC application using ATL c++.

    In the MMC left scope, the items have a image that will represent the item's state(Started or stopped).

    And i have a thread to update the MMC left scope item's image according to the item's state.

    The code that update item image like the following:
    (the following code will be executed in the thread function)

    while( application is running )
    //get the item's state and then define a SCOPEDATAITEM and put image id to it.

            NULL, lClosedImage, lOpenImage, 0, 0, 0,
          0, lID };

    //update the item's image
    m_pIConsole->SetItem(&sdi)  //m_pIConsole is a CComPtr<IConsoleNameSpace2>

    Run my MMC application, i can see the item's image could swithover according to its state.

    But when i look at my MMC application's memory usage in Task Mangaer, i found the memory usage of my mmc appliction keep increasing.

    If i remove the code that update the item's image(m_pIConsole->SetItem(&sdi)), the memory usage would not keep increasing.

    Is there anybody have the same experience?

    How can i avoid this?

    More interesting thing is that if i minimize my mmc application, the memory usage will stop increasing.


    Thursday, November 20, 2008 5:06 AM

All replies