<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Potential memory leak</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Potential memory leak</description>
  <pubDate>Wed, 29 Jul 2026 16:54:01 -700</pubDate>
  <lastBuildDate>Fri, 11 Feb 2011 13:45:50 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2499</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Potential memory leak : When youwrote &amp;#034;where there...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9931#9931</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 2499<br /><strong>Posted:</strong> 11-Feb-2011 at 1:45pm<br /><br />When you&nbsp;wrote "<EM>where there is a combobox in an edittemplate in a datagrid</EM> " alarm bells went off for me. There is a known memory leak when the data template is defined inline, rather than as a resource.&nbsp;Microsoft has been trying to patch the problem but hasn't completely succeeded. Maybe next release.&nbsp; I suggest you move your template into a resource (can be a resource of the UserControl) and see if that helps.<DIV>&nbsp;</DIV><DIV>You wrote "<EM>It is not related to having, or not having errors. The event handler is making, in some cases, silverlight controls leak.</EM>"&nbsp; What DevForce event are you referring to? I don't see it in your account.</DIV><DIV>&nbsp;</DIV><DIV>It is a hopeful sign that you get the same effect with MS controls. Maybe - after you've first tried to resolve by moving the template to a resource - if the problem persists - you can make a small test case for us.</DIV><DIV>&nbsp;</DIV><DIV>Until then, we are at a loss to help as we don't know how to repro.</DIV>]]>
   </description>
   <pubDate>Fri, 11 Feb 2011 13:45:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9931#9931</guid>
  </item> 
  <item>
   <title>Potential memory leak : Hi midnit;Thanks for the additional...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9924#9924</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2499<br /><strong>Posted:</strong> 11-Feb-2011 at 9:52am<br /><br />Hi midnit;<div><br></div><div>Thanks for the additional info. Let me check into this and get back to you.</div>]]>
   </description>
   <pubDate>Fri, 11 Feb 2011 09:52:24 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9924#9924</guid>
  </item> 
  <item>
   <title>Potential memory leak : Though this shows RadComboBox...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9922#9922</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=531" rel="nofollow">midnit</a><br /><strong>Subject:</strong> 2499<br /><strong>Posted:</strong> 11-Feb-2011 at 4:51am<br /><br /><DIV>Though this shows RadComboBox I have tried microsofts with the same result. This is the retention graph of 1 of the 5 comboboxes after putting the same cell into edit mode 5 times.</DIV><DIV>&nbsp;</DIV><DIV><img src="http://www.ideablade.com/forum/uploads/531/2-11-2011_7-48-52_AM.png" height="367" width="1598" border="0" /> </DIV><span style="font-size:10px"><br /><br />Edited by midnit - 11-Feb-2011 at 4:52am</span>]]>
   </description>
   <pubDate>Fri, 11 Feb 2011 04:51:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9922#9922</guid>
  </item> 
  <item>
   <title>Potential memory leak : I didn&amp;#039;t give enough info,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9921#9921</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=531" rel="nofollow">midnit</a><br /><strong>Subject:</strong> 2499<br /><strong>Posted:</strong> 11-Feb-2011 at 4:35am<br /><br />I didn't give enough info, my apologies.<DIV>&nbsp;</DIV><DIV>It is not related to having, or not having errors. The event handler is making, in some cases, silverlight controls leak. I have not been able to identify the exact circumstances but I am seeing in several cases where there is a combobox in an edittemplate in a datagrid and when the cell goes into edit mode that combobox is created but when leaving edit mode the combobox sits in memory and is tied to that _errorsChangedHandler. Then if you go back into edit mode another is created, over and over.</DIV><DIV>&nbsp;</DIV><DIV><strong>I am guessing here</strong> but it <EM>appears</EM> that if I use a List&lt;MyEntity&gt; where the MyEntity has no circular references that the combobox will be destroyed, but if I use an Entity A that links B and C, and B links to A and C, and C links to A and B then the combobox gets left in memory.</DIV><DIV>&nbsp;</DIV><DIV>I have a work-around that when it leaves edit mode if I reset the ItemsSource binding to an empty binding the combobox will be destroyed. Unfortunately that means I have to handle each type of control that exhibits this behavior.</DIV>]]>
   </description>
   <pubDate>Fri, 11 Feb 2011 04:35:39 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9921#9921</guid>
  </item> 
  <item>
   <title>Potential memory leak : Hi midnit;We checked into this...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9917#9917</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2499<br /><strong>Posted:</strong> 10-Feb-2011 at 5:01pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; "><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Hi midnit;<div><br></div><div>We checked into this and did a test creating 100,000 entities with errors. The resulting difference between memory at the start and at the end of the operation was around 5000 bytes, which is normal.</div><div><br></div><div><div>&nbsp;&nbsp; &nbsp;&#091;TestMethod&#093;</div><div>&nbsp;&nbsp; &nbsp;public void MemoryCheckWithErrorsChangedHandler() {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;var mgr = new DomainModelEntityManager();</div><div>&nbsp;&nbsp; &nbsp; &nbsp;MemoryCheckCore(mgr);</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;long memStart = GC.GetTotalMemory(true);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;for (int i = 0; i &lt; 10; i++) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;MemoryCheckCore(mgr);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp;mgr = null;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;long memEnd = GC.GetTotalMemory(true);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;long diff = memEnd - memStart;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;Assert.IsTrue(diff &lt; 10000);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;Console.WriteLine("diff = " + diff);</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;private void MemoryCheckCore(DomainModelEntityManager mgr) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;var employees = CreateTestEmployees(mgr);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;foreach (var emp in employees) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var indei = (INotifyDataErrorInfo)emp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;indei.ErrorsChanged += indei_ErrorsChanged;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;GenerateErrors(emp);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Assert.IsTrue(emp.EntityAspect.ValidationErrors.Count &gt; 0);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;//This does the same thing as mgr.Clear()</div><div>&nbsp;&nbsp; &nbsp; &nbsp;//foreach (var emp in employees) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;// &nbsp;var indei = (INotifyDataErrorInfo)emp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;// &nbsp;indei.ErrorsChanged -= indei_ErrorsChanged;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;// &nbsp;indei = null;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;// &nbsp;emp.EntityAspect.RemoveFromManager();</div><div>&nbsp;&nbsp; &nbsp; &nbsp;//}</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;employees = null;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;mgr.Clear();</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;private List&lt;Employee&gt; CreateTestEmployees(DomainModelEntityManager mgr) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;for (int i = 0; i &lt; 10000; i++) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;//var emp = mgr.CreateEntity&lt;Employee&gt;();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var emp = new Employee();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;emp.Id = -(i + 100);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;//emp.EntityAspect.AddToManager();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mgr.AddEntity(emp);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp;return mgr.Employees.With(QueryStrategy.CacheOnly).ToList(); &nbsp; &nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;private void GenerateErrors(Employee emp) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;emp.FirstName = null;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;emp.LastName = null;</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;void indei_ErrorsChanged(object sender, DataErrorsChangedEventArgs e) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;var propName = e.PropertyName;</div><div>&nbsp;&nbsp; &nbsp;}</div></div></div></div>]]>
   </description>
   <pubDate>Thu, 10 Feb 2011 17:01:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9917#9917</guid>
  </item> 
  <item>
   <title>Potential memory leak : I have been working with Telerik...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9914#9914</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=531" rel="nofollow">midnit</a><br /><strong>Subject:</strong> 2499<br /><strong>Posted:</strong> 10-Feb-2011 at 6:19am<br /><br />I have been working with Telerik for some time trying to track down what I figured was a leak in their controls but it may not be. I am passing this info on so please look and see if this is relevant to your product also as right now I see no way for me to correct the issue. I am not using their RadDomainDataSource. Any idea's?<DIV>&nbsp;</DIV><DIV>Thanks for looking in to this.</DIV><DIV>&nbsp;</DIV><DIV><DIV style="BORDER-BOTTOM: #cccccc 1px dotted; PADDING-BOTTOM: 4px"><B>From:&nbsp;Telerik Admin</B><BR>Date:&nbsp;2/10/2011 9:01:45 AM<BR></DIV><DIV></DIV><DIV ="threadMessage">Hi Robert, <P>Indeed we found an issue with INotifyDataErrorInfo.ErrorsChanged event handlers and we fixed with our latest internal build. Be aware that we made this fix only for our own controls RadDomainDataSource + RadGridView, since we found that memory leak is caused by DomainContext.EntitySet collection which does not clean its references. I have no idea if this fix will work with IdeaBlade's DevForce, but the idea is to clear EntitySet on refresh of the items source.<BR>Let me know if there is something unclear.</P>Greetings,<BR>Nedyalko Nikolov <BR>the Telerik team <DIV ="forumBalo&#111;nTop"></DIV><DIV ="forumBalo&#111;n">Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. <U><FONT color=#810081></FONT></U></DIV></DIV><BR><BR><BR><BR><SPAN style="FONT-FAMILY: Arial, Verdana; FONT-SIZE: 12px"><DIV style="BORDER-BOTTOM: #cccccc 1px dotted; PADDING-BOTTOM: 4px"><B>From:&nbsp;Tyree</B><BR>Date:&nbsp;2/10/2011 8:49:28 AM<BR></DIV><DIV></DIV><DIV ="threadMessage"><STRIKE>I am unable to find anything additional that is holding onto things. We are also seeing memory increases every time we sort on these effected pages. I am leaning toward thinking it has something to do with Entities that have multiple cross relationships as in: A links to B and C, B links to A and C, C links to A and B.<BR><BR>Our grid is bound through the ItemsSource to a CollectionViewSource.View.<BR><BR></STRIKE><strong>I am seeing a lot of (this as EntityWrapper)._errorsChangedHandler that seems to still be connected to things when it seemingly shouldn't. We are using IdeaBlades DevForce.<BR><BR></strong>I am still looking...</DIV><BR></SPAN></DIV><span style="font-size:10px"><br /><br />Edited by midnit - 10-Feb-2011 at 6:29am</span>]]>
   </description>
   <pubDate>Thu, 10 Feb 2011 06:19:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2499&amp;PID=9914#9914</guid>
  </item> 
 </channel>
</rss>