<?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="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Severe Memory Leak</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : Severe Memory Leak]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 15 May 2026 11:57:50 +0000</pubDate>
  <lastBuildDate>Mon, 15 Jun 2009 16:23:42 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=7921</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Severe Memory Leak : I had a confirmation from already...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=49963&amp;title=severe-memory-leak#49963</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 7921<br /><strong>Posted:</strong> 15 June 2009 at 4:23pm<br /><br />I had a confirmation from already closed Issue:<DIV>Hi, No more leaks in 13.1 Beta. Thanks!<BR>But: Is it my feeling that the Report still uses quite a bit of memory (1Kb per row)<BR></DIV>]]>
   </description>
   <pubDate>Mon, 15 Jun 2009 16:23:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=49963&amp;title=severe-memory-leak#49963</guid>
  </item> 
  <item>
   <title><![CDATA[Severe Memory Leak :    sserge wrote:The problem...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=26267&amp;title=severe-memory-leak#26267</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1755">ABuenger</a><br /><strong>Subject:</strong> 7921<br /><strong>Posted:</strong> 21 September 2007 at 6:22am<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by sserge" alt="Originally posted by sserge" style="vertical-align: text-bottom;" /> <strong>sserge wrote:</strong><br /><br />The problem is related to&nbsp;MFC 6.0 CString implementation. CString objects have internal cache and do not deallocate memory when string is destroyed. Their memory is kept in the cache and reused in the feature string allocations. (This was useful in the old windows versions)<br><br>This is not a leak, just such behavior.<br></td></tr></table><br><br>CString in MFC 6.0 uses CFixedAlloc for memory allocation which, as Serge said, keeps a list of all allocated memory for reusage in the release build. So it's actually not a leak but a feature.<br><br>]]>
   </description>
   <pubDate>Fri, 21 Sep 2007 06:22:00 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=26267&amp;title=severe-memory-leak#26267</guid>
  </item> 
  <item>
   <title><![CDATA[Severe Memory Leak : Some more information:  Report...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=26205&amp;title=severe-memory-leak#26205</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 7921<br /><strong>Posted:</strong> 20 September 2007 at 5:43pm<br /><br />Some more information:<br><br>Report control has 2 features to optimize memory usage. <br>This is useful for big amount of records (more than 10 000).<br> <br>Let me note that features described below has real effect in Release build only.<br>In Debug build, program which used these features may work even slower than without them.<br> <br>1. Custom Heap.<br>Some Report Control classes, which represent data (records, record items and rows),<br>has overridden new/delete operators which use own Allocator object to allocate/deallocate<br>memory on object create.<br>The allocator has 2 modes: <br>&nbsp;&nbsp;1. Standard (by default) - the default application heap is used, as for any other Objects.<br>&nbsp;&nbsp;2. CustomHeap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- the separate custom heap is used by this allocator. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(See HeapCreate and other related Windows API functions)<br> <br>Allocator manage custom heap internally. <br>When all objects deleted - allocator destroy heap (and create again for next allocations).<br>This "Really" free all memory after all data removed and avoid Heap fragmentation problem.<br> <br>Also by default Allocator enable "Low-fragmentation Heap" (LFH) feature for custom heap.<br>This optimize heap work in WinXP and later. But it does not works under debugger.<br> <br>2. Batch Allocation.<br>If we need to allocate many objects of the same type (size) it is more effective <br>to allocate memory not for each object separately, but for some amount of such objects at one time (by batch).<br> <br>Batch Allocation implemented over Custom heap. <br>This means that it can alloc batches in the standard heap as far as in the custom heap.<br> <br>When you call "new" for some batch allocable class,<br>Batch Allocation mechanism allocate block for 1024 objects in the heap, <br>return pointer for one object and add other 1023 to "Free List".<br>For feature allocations objects from this "Free List" will be returned instead of new allocation in the heap.<br>When free list will be empty - new batch block will be allocated and added to "Free List".<br> <br>Whensuch object deleted (operator delete called) - it is added to "FreeList" too (and will be used again for future allocations).<br> <br>This is increase allocation/deallocation speed and allow to avoid heap fragmentation.<br> <br>Batch Allocation manage list of batch blocks and list of free objects in each block.<br>When all objects from some batch block is in free list - such block deleted automatically.<br>FreeExtraData() method allow to delete these batch blocks from memory (from heap).<br> <br>This means that you have to call FreeExtraData after Remove All records and rows to really free memory.<br>But if you plan to add some data again you should not do this. <br>In this case you may call FreeExtraData after add new records and populate.<br><br>--<br>WBR,<br>Serge<br>]]>
   </description>
   <pubDate>Thu, 20 Sep 2007 17:43:21 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=26205&amp;title=severe-memory-leak#26205</guid>
  </item> 
  <item>
   <title><![CDATA[Severe Memory Leak : Copying there an answer to this...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=26204&amp;title=severe-memory-leak#26204</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=862">sserge</a><br /><strong>Subject:</strong> 7921<br /><strong>Posted:</strong> 20 September 2007 at 5:42pm<br /><br />Copying there an answer to this question from support area:<br><br>The problem is related to&nbsp;MFC 6.0 CString implementation. CString objects have internal cache and do not deallocate memory when string is destroyed. Their memory is kept in the cache and reused in the feature string allocations. (This was useful in the old windows versions)<br><br>This is not a leak, just such behavior. <br><br>You can click Fill and Clear many times and see that used memory will not grow and grow as for the leak.<br> <br>I see only one way to fix this - use MFC 8.0 OCX build. MFC 8.0 CString implementation has no such cache.<br> <br><br>Also to optimize memory usage you can enable the following features:<br> <br>Private Sub Form_Initialize()<br>&nbsp;&nbsp;ReportControlGlobalSettings.UseReportCustomHeap<br>&nbsp;&nbsp;ReportControlGlobalSettings.UseBatchAllocation&nbsp;&nbsp;<br>End Sub<br><br> <br>Also you may use <br>&nbsp;&nbsp;ReportControlGlobalSettings.FreeBatchExtraData<br>after remove all data to free cached memory.<br> <br>--<br>WBR,<br>Serge<br>]]>
   </description>
   <pubDate>Thu, 20 Sep 2007 17:42:34 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=26204&amp;title=severe-memory-leak#26204</guid>
  </item> 
  <item>
   <title><![CDATA[Severe Memory Leak : ... any idea CJ team ? ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=26027&amp;title=severe-memory-leak#26027</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2501">mav46</a><br /><strong>Subject:</strong> 7921<br /><strong>Posted:</strong> 17 September 2007 at 10:54am<br /><br />... any idea CJ team ?]]>
   </description>
   <pubDate>Mon, 17 Sep 2007 10:54:00 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=26027&amp;title=severe-memory-leak#26027</guid>
  </item> 
  <item>
   <title><![CDATA[Severe Memory Leak : yes, it&amp;#039;s true. I&amp;#039;have...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=25634&amp;title=severe-memory-leak#25634</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2501">mav46</a><br /><strong>Subject:</strong> 7921<br /><strong>Posted:</strong> 07 September 2007 at 10:05am<br /><br />yes, it's true. I'have realize it on one of my projects. I have the same memory leak when I populate the report control with a custom caption on all the filed of the report .....<DIV>&nbsp;</DIV><DIV>There is a urgent need to solve this bug, please.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 07 Sep 2007 10:05:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=25634&amp;title=severe-memory-leak#25634</guid>
  </item> 
  <item>
   <title><![CDATA[Severe Memory Leak :  Is there any response on this?...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=25543&amp;title=severe-memory-leak#25543</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=902">dhugal</a><br /><strong>Subject:</strong> 7921<br /><strong>Posted:</strong> 04 September 2007 at 12:31pm<br /><br /><DIV>&nbsp;</DIV><DIV>Is there any response on this? </DIV><DIV>&nbsp;</DIV><DIV>I have made a support request - no response.</DIV><DIV>I have tried phoning you guys on the international number&nbsp;all afternoon - no answer (12 noon EST).</DIV><DIV>&nbsp;</DIV><DIV>Please help me! </DIV>]]>
   </description>
   <pubDate>Tue, 04 Sep 2007 12:31:53 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=25543&amp;title=severe-memory-leak#25543</guid>
  </item> 
  <item>
   <title><![CDATA[Severe Memory Leak : We have been using the Code Jock...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=25475&amp;title=severe-memory-leak#25475</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=902">dhugal</a><br /><strong>Subject:</strong> 7921<br /><strong>Posted:</strong> 03 September 2007 at 3:20am<br /><br /><P>We have been using the Code Jock controls for some time but just recently our application seems to be using a lot lot more ram. I did some investigation and it appears that when we use the Report Grid control and add a lot of items where we set the caption to be different from the value (we do this for all numeric &amp; date fields because we format them nicely for the user) the grid exhibits a severe memory leak.</P><P>I have put together an example project demonstrating this:</P><DIV><a href="https://forum.codejock.com/uploads/20070903_032029_ReportC&#111;ntrolMe.zip" target="_blank">uploads/20070903_032029_ReportControlMe.zip</A></DIV><DIV>&nbsp;</DIV><DIV>If you fill the grid with 20,000 rows each the control consumes a fair amount of ram as expected - when you then clear it all of that ram is freed (correction - most). If however you fill it with the same number of rows and explicitely set the caption on each of the values the grid consumes a lot of ram again but when you clear it is not all freed - in fact a large percent is never freed. When I am running this in a VB6 IDE the ram isn't even freed when I close the application and I have to terminate the IDE to free it.</DIV><P>The memory figures (KB) with 20,000 records / 40 Columns are as follows:</P><P>Project started in IDE and form displayed: 14,920<BR>Grid filled with rows but Caption not set: 198,824<BR>Grid then cleared: 17,272 <BR>(A slight gain that needs to be checked we have lost 3 meg somewhere)<BR>Grid then filled with rows and Caption set explicitely: 261,868<BR>Grid then cleared: 129,352<BR><strong>(We have lost over 100 meg of ram somewhere!)</P><DIV></strong><BR>App closed return to VB design environmentGrid then cleared: 129,380</DIV><DIV><strong>(We have still not reclaimed the missing 100 meg!)</strong></DIV><P>This is obviously very urgent for us as we are using this with a very high number of users in a Terminal Services environment so any memory leaks result in degredation of the server performance and eventual crashes in our application.</P><P>Can you give me an estimate for a fix please?</P><P>Dhugal.</P>]]>
   </description>
   <pubDate>Mon, 03 Sep 2007 03:20:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7921&amp;PID=25475&amp;title=severe-memory-leak#25475</guid>
  </item> 
 </channel>
</rss>