locked
Possible memory leakage in WinJS Binding

    Question

  • from the MSDN:

    Important  When you perform declarative binding, you should always set the WinJS.Binding.optimizeBindingReferences property to true in the startup procedure for your app. If you do not do so, the bindings in your app may leak memory.

    Why isn't that enabled immediately when the user first uses declarative binding? Or enabled by default?

    Tuesday, October 02, 2012 11:15 AM

Answers

  • In the RTM versions of the javascript templates, the optimizeBindingReferences is set to true by default in the default.js

    Nick Eubanks (MSFT)

    • Marked as answer by Song Tian Thursday, October 18, 2012 7:02 AM
    Tuesday, October 02, 2012 6:23 PM

All replies

  • In the RTM versions of the javascript templates, the optimizeBindingReferences is set to true by default in the default.js

    Nick Eubanks (MSFT)

    • Marked as answer by Song Tian Thursday, October 18, 2012 7:02 AM
    Tuesday, October 02, 2012 6:23 PM
  • This still does not answer the question why this is not enabled by default in the WinJS library. Or why is that even an option. Why would anyone choose to not optimize the binding references?
    Thursday, October 18, 2012 8:15 AM
  • Just ran into this during app certification. 

    It states:

    The Optimized Binding References test detected the following errors

    Impact if not fixed:  When using bindings, WinJS.Binding.optimizeBindingReferences should be set to true to optimize the memory usage. 
    How to fix:  Set WinJS.Binding.optimizeBindingReferences to true in the app's JavaScript. 

    First of all some linguistic thing: How can that be a FAILURE in cert if it says "should be set to true". So its not required. 

    If it is indeed required, why isn't it set to true by DEFAULT in WinJS. Why do programmer have to take care of that? Or let me rephrase: Why would ANYONE set it to false in the first place? MSFT should fix that in WinJS with the next update. Can you imagine not all programmers use the default VS templates to write their WinJS app?

    Friday, November 30, 2012 11:42 AM