locked
Memory leaks RRS feed

  • Question

  • Hi

    We have a large SL 4 application using the MVVM methodology and we're slightly concerned about its use of memory and potential memory leaks. As a complete newbie in this area has anyone got any advice on how best to monitor the application to ensure that objects are only hanging around as long as they need to etc....preferably using a non-cost option!

    Thanks

    Thursday, July 1, 2010 8:58 AM

Answers

  • there are two documented causes of memory leaks here

    http://forums.silverlight.net/forums/t/171739.aspx

    -- Memory Leak Issue with inline DataTemplates in Xaml 

    -- Memory leak with navigation control and a vb page using a wcf service (may or may not apply to C#)

    the tool for tracking memory leaks is windbg  (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=36a2630f-5d56-43b5-b996-7633f2ec14ff)

    I use it like this

    1 - don't run your application  

    2 - in the standard windows task manager jot down all the pids for iexplorer

       --- if the pid is not already shown click "view", "select columns"

    3 - start your application from IIS

    4 - find the new iexplorer pid in task manager

    5 - start windbg

    6 - click "File", attach to process

    7 - at the bottom of the window that just opened you can enter commands

    enter      .loadby sos coreclr

    8 - enter this command   !dumpheap -stat

    9 - select the results of the above command and press ctrl C

    10 - open excel, new sheet, ctrl V

    then click on the paste icon that appears at the bottom of the pasted cell and select “use text import wizard” option

    import the data as fixed columns separated by blanks

    now you can see what is using memory the problem of how to release it will remain but at least you'll know where to start looking.

     

    Thursday, July 1, 2010 9:11 AM

All replies

  • there are two documented causes of memory leaks here

    http://forums.silverlight.net/forums/t/171739.aspx

    -- Memory Leak Issue with inline DataTemplates in Xaml 

    -- Memory leak with navigation control and a vb page using a wcf service (may or may not apply to C#)

    the tool for tracking memory leaks is windbg  (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=36a2630f-5d56-43b5-b996-7633f2ec14ff)

    I use it like this

    1 - don't run your application  

    2 - in the standard windows task manager jot down all the pids for iexplorer

       --- if the pid is not already shown click "view", "select columns"

    3 - start your application from IIS

    4 - find the new iexplorer pid in task manager

    5 - start windbg

    6 - click "File", attach to process

    7 - at the bottom of the window that just opened you can enter commands

    enter      .loadby sos coreclr

    8 - enter this command   !dumpheap -stat

    9 - select the results of the above command and press ctrl C

    10 - open excel, new sheet, ctrl V

    then click on the paste icon that appears at the bottom of the pasted cell and select “use text import wizard” option

    import the data as fixed columns separated by blanks

    now you can see what is using memory the problem of how to release it will remain but at least you'll know where to start looking.

     

    Thursday, July 1, 2010 9:11 AM
  • Hi, have a look at http://forums.silverlight.net/forums/t/188349.aspx hope this helps.

    Thursday, July 1, 2010 9:13 AM