<?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 : Memory leak with one-to-one associations</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Memory leak with one-to-one associations</description>
  <pubDate>Tue, 12 May 2026 21:33:28 -700</pubDate>
  <lastBuildDate>Mon, 15 Apr 2013 10:22: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=4044</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>Memory leak with one-to-one associations : Manju, any bug reported in DF2010...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16225#16225</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 4044<br /><strong>Posted:</strong> 15-Apr-2013 at 10:22am<br /><br />Manju, any bug reported in DF2010 which also affects DF2012 will be fixed in both products.  We fixed the DF2010 bug in the latest release last week, and we'll fix the DF2012 bug in the next release.  We don't yet have a date for this.]]>
   </description>
   <pubDate>Mon, 15 Apr 2013 10:22:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16225#16225</guid>
  </item> 
  <item>
   <title>Memory leak with one-to-one associations : HiWe have our application in DevForce...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16223#16223</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1754" rel="nofollow">myr_zero</a><br /><strong>Subject:</strong> 4044<br /><strong>Posted:</strong> 15-Apr-2013 at 5:23am<br /><br />Hi<div><br></div><div>We have our application in DevForce 2012. Same problem exists there too :( This causing lot of memory leaks. Its good if fix to this is available soon.</div><div><br></div><div>Thanks</div><div>Manju</div>]]>
   </description>
   <pubDate>Mon, 15 Apr 2013 05:23:14 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16223#16223</guid>
  </item> 
  <item>
   <title>Memory leak with one-to-one associations : We weren&amp;#039;t able to look at...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16126#16126</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 4044<br /><strong>Posted:</strong> 25-Mar-2013 at 2:41pm<br /><br />We weren't able to look at this for the 6.1.12 release.  Barring problems, this should be included in the next maintenance release in April.  Exact date is still TBD.]]>
   </description>
   <pubDate>Mon, 25 Mar 2013 14:41:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16126#16126</guid>
  </item> 
  <item>
   <title>Memory leak with one-to-one associations : Any estimate on when a fix would...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16123#16123</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=613" rel="nofollow">stephenmcd1</a><br /><strong>Subject:</strong> 4044<br /><strong>Posted:</strong> 25-Mar-2013 at 1:20pm<br /><br />Any estimate on when a fix would be available? &nbsp;It seems the problem still exists in 6.1.12...]]>
   </description>
   <pubDate>Mon, 25 Mar 2013 13:20:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16123#16123</guid>
  </item> 
  <item>
   <title>Memory leak with one-to-one associations : Hi Stephen,  I verified the unwanted...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16018#16018</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 4044<br /><strong>Posted:</strong> 14-Mar-2013 at 2:15pm<br /><br />Hi Stephen,<br /><br />I verified the unwanted behavior and filed a bug report.<br />I'll follow up with you once we have a fix.<br /><br />]]>
   </description>
   <pubDate>Thu, 14 Mar 2013 14:15:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16018#16018</guid>
  </item> 
  <item>
   <title>Memory leak with one-to-one associations : I&amp;#039;ve been tracing some more...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16005#16005</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=613" rel="nofollow">stephenmcd1</a><br /><strong>Subject:</strong> 4044<br /><strong>Posted:</strong> 13-Mar-2013 at 2:01pm<br /><br />I've been tracing some more memory leaks and found some odd behavior of the EntityManager.UnresolvedParentMap where it would end up holding on to&nbsp;detached&nbsp;entities - leading to a memory leak in our app. &nbsp;It took some narrowing down but it seems to only happen when there is a one-to-one relationship (or at least that is where we noticed it in our app and that is the only way I could reproduce it - but perhaps it happens in other cases). &nbsp;To reproduce it, I started with the NorthwindIB database and added a new table called "EmployeeDetail" that is basically a one-to-one with an Employee (I guess it is technically a One-to-OneOrZero). &nbsp;It looks like this:<div><img src="uploads/613/EmployeeDetailDiagram.png" height="205" width="413" border="0" /><br></div><div><br></div><div>If I just make a new employee in an entity manager and then immediately remove it, the employee remains in the UnresolvedParentMap collection even though it is now&nbsp;detached. &nbsp;And since it's being held by the UnresolvedParentMap, it won't ever get garbage collected and we end up with a memory leak (in our case, the Entity Manager sticks around for a while so we want to be able to evict entities and have them&nbsp;garbage&nbsp;collected).</div><div><br></div><div>Here is some test code that demonstrates the problem. &nbsp;If we pick any other entity type (without one-to-one relationships), it will run fine. &nbsp;It's just this Employee example that will break:<table width="99%"><tr><td><pre class="BBcode">&#091;TestMethod&#093;</div><div>public void TestUnresolvedParentMap()</div><div>{</div><div>&nbsp; &nbsp; var em = new EntityManager();</div><div><br></div><div>&nbsp; &nbsp; //Make a new Employee</div><div>&nbsp; &nbsp; var e = em.CreateEntity&lt;Employee&gt;();</div><div>&nbsp; &nbsp; e.EntityAspect.AddToManager();</div><div>&nbsp; &nbsp; e.EmployeeID = 10; //Giving it an ID isn't necessary for the bug</div><div><br></div><div>&nbsp; &nbsp; //Immediately remove it from the entity manager - in this case, we'd assume it&nbsp;</div><div>&nbsp; &nbsp; // &nbsp;disappears forever...</div><div>&nbsp; &nbsp; e.EntityAspect.RemoveFromManager();</div><div><br></div><div>&nbsp; &nbsp; //Sanity check - it became detached and the entity manager no longer thinks it is loaded</div><div>&nbsp; &nbsp; Assert.AreEqual(EntityState.Detached, e.EntityAspect.EntityState);</div><div>&nbsp; &nbsp; Assert.IsFalse(em.IsEntityLoaded(e.EntityAspect.EntityKey));</div><div><br></div><div>&nbsp; &nbsp; //If we break into the debugger at this point, we can see that em.UnresolvedParentMap is still&nbsp;</div><div>&nbsp; &nbsp; // &nbsp; holding on to our employee even though it is detached.</div><div><br></div><div>&nbsp; &nbsp; //To double check, we'll use a weak reference to hold on to the employee</div><div>&nbsp; &nbsp; var wr = new WeakReference(e);</div><div><br></div><div>&nbsp; &nbsp; //Clear out of 'strong' reference and force garbage collection to happen</div><div>&nbsp; &nbsp; e = null;</div><div>&nbsp; &nbsp; GC.Collect();</div><div><br></div><div>&nbsp; &nbsp; //At this point, we'd expect the employee to be gone. &nbsp;But it's not!</div><div>&nbsp; &nbsp; Assert.IsFalse(wr.IsAlive);</div><div>}</pre></td></tr></table></div>]]>
   </description>
   <pubDate>Wed, 13 Mar 2013 14:01:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4044&amp;PID=16005#16005</guid>
  </item> 
 </channel>
</rss>