# Memory Leak in ShapeFileFeatureLayer

**URL:** <https://community.thinkgeo.com/t/memory-leak-in-shapefilefeaturelayer/3001>\
**Category:** WPF\
**Created:** [May 23, 2011, 7:10pm UTC](https://community.thinkgeo.com/t/memory-leak-in-shapefilefeaturelayer/3001 "2011-05-23T19:10:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/3da27b/32.png) [@Ryan1](https://community.thinkgeo.com/u/Ryan1)\
**Post date:** [May 23, 2011, 7:10pm UTC](https://community.thinkgeo.com/t/memory-leak-in-shapefilefeaturelayer/3001/1 "2011-05-23T19:10:13Z")

</div>

Greetings,

I've&nbsp;been&nbsp;running&nbsp;a&nbsp;memory&nbsp;profiler&nbsp;on&nbsp;my&nbsp;application&nbsp;to&nbsp;track&nbsp;down&nbsp;a&nbsp;memory&nbsp;leak&nbsp;and&nbsp;believe&nbsp;I&nbsp;have&nbsp;found&nbsp;one&nbsp;in&nbsp;the&nbsp;map&nbsp;control&nbsp;in&nbsp;the&nbsp;process.&nbsp;&nbsp;When&nbsp;you&nbsp;zoom&nbsp;or&nbsp;pan&nbsp;around&nbsp;an&nbsp;area **&nbsp;that&nbsp;is&nbsp;NOT&nbsp;cached** &nbsp;a&nbsp;large&nbsp;number&nbsp;of&nbsp;instances&nbsp;of&nbsp;EventHandler\<StreamLoadingEventArgs\>&nbsp;are&nbsp;created&nbsp;and&nbsp;never&nbsp;disposed.&nbsp;&nbsp;It&nbsp;appears&nbsp;to&nbsp;be&nbsp;on&nbsp;2&nbsp;classes&nbsp;actually,&nbsp;ThinkGeo.MapSuite.Core.GeoDbf&nbsp;and&nbsp;some&nbsp;obfuscated&nbsp;one&nbsp;(mbQ=.80A=)&nbsp;(I'm&nbsp;guessing&nbsp;maybe&nbsp;something&nbsp;to&nbsp;do&nbsp;with&nbsp;the&nbsp;index&nbsp;file).&nbsp;&nbsp;This&nbsp;is&nbsp;causing&nbsp;my&nbsp;application&nbsp;to&nbsp;use&nbsp;sometimes&nbsp;up&nbsp;to&nbsp;1-2MB&nbsp;each&nbsp;pan/zoom&nbsp;operation.

Any&nbsp;help&nbsp;would&nbsp;be&nbsp;appreciated.

&nbsp;

Thanks,

.Ryan.

&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [May 30, 2011, 4:04pm UTC](https://community.thinkgeo.com/t/memory-leak-in-shapefilefeaturelayer/3001/2 "2011-05-30T16:04:42Z")

</div>

Ryan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;ran&nbsp;a&nbsp;memory&nbsp;profiler&nbsp;on&nbsp;our&nbsp;HowDoISamples&nbsp;and&nbsp;when&nbsp;I&nbsp;zoom&nbsp;or&nbsp;pan&nbsp;the&nbsp;map,&nbsp;there&nbsp;are&nbsp;not&nbsp;any&nbsp;memory&nbsp;leak&nbsp;from&nbsp;the&nbsp;GeoDbf&nbsp;class&nbsp;or&nbsp;any&nbsp;other&nbsp;classed,&nbsp;the&nbsp;resources&nbsp;can&nbsp;be&nbsp;disposed&nbsp;properly.&nbsp;Can&nbsp;you&nbsp;tell&nbsp;me&nbsp;what’s&nbsp;the&nbsp;version&nbsp;number&nbsp;you&nbsp;used?&nbsp;The&nbsp;latest&nbsp;version&nbsp;number&nbsp;is&nbsp;5.0.0.16.&nbsp;Also&nbsp;you&nbsp;are&nbsp;using&nbsp;the&nbsp;latest&nbsp;version&nbsp;and&nbsp;still&nbsp;find&nbsp;out&nbsp;the&nbsp;memory&nbsp;leak&nbsp;problem&nbsp;from&nbsp;the&nbsp;GeoDbf&nbsp;class&nbsp;or&nbsp;any&nbsp;other&nbsp;classes&nbsp;can&nbsp;you&nbsp;send&nbsp;your&nbsp;sample&nbsp;application&nbsp;to&nbsp;us?&nbsp;Maybe&nbsp;you&nbsp;did&nbsp;something&nbsp;else&nbsp;in&nbsp;your&nbsp;application&nbsp;to&nbsp;cause&nbsp;the&nbsp;memory&nbsp;leak&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Scott,
