<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 1.0cm 2.0cm 3.0cm;}
div.WordSection1
{page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=LT link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span lang=EN-US>Hello, I have found that after calling featureService.SelectFeatures
, memory is not realeased. Here is my source code:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#2B91AF'>MgUserInformation</span><span
style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#010001'>userInfo</span>
= <span style='color:blue'>new</span> <span style='color:#2B91AF'>MgUserInformation</span>(<span
style='color:#010001'>„Adminitrator“</span>, <span
style='color:#010001'>„admin“</span>);<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:#2B91AF'>MgSiteConnection</span><span style='font-size:10.0pt;font-family:
"Courier New"'> <span style='color:#010001'>siteConnection</span> = <span
style='color:blue'>new</span> <span style='color:#2B91AF'>MgSiteConnection</span>();<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:#010001'>siteConnection</span><span style='font-size:10.0pt;font-family:
"Courier New"'>.<span style='color:#010001'>Open</span>(<span style='color:
#010001'>userInfo</span>);</span><span lang=EN-US><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#2B91AF'>MgFeatureService</span><span
style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#010001'>featureService</span>
= (<span style='color:#2B91AF'>MgFeatureService</span>)<span style='color:#010001'>siteConnection</span>.<span
style='color:#010001'>CreateService</span>(<span style='color:#2B91AF'>MgServiceType</span>.<span
style='color:#010001'>FeatureService</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#2B91AF'>MgFeatureQueryOptions</span><span
style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#010001'>Query</span>
= <span style='color:blue'>new</span> <span style='color:#2B91AF'>MgFeatureQueryOptions</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
<span style='color:green'><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#010001'>d11</span> = <span
style='color:#010001'>X</span> - <span style='color:#010001'>prec</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#010001'>d12</span> = <span
style='color:#010001'>Y</span> - <span style='color:#010001'>prec</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#010001'>d21</span> = <span
style='color:#010001'>X</span> + <span style='color:#010001'>prec</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#010001'>d22</span> = <span
style='color:#010001'>Y</span> - <span style='color:#010001'>prec</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#010001'>d31</span> = <span
style='color:#010001'>X</span> + <span style='color:#010001'>prec</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#010001'>d32</span> = <span
style='color:#010001'>Y</span> + <span style='color:#010001'>prec</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#010001'>d41</span> = <span
style='color:#010001'>X</span> - <span style='color:#010001'>prec</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>double</span><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:#010001'>d42</span> = <span
style='color:#010001'>Y</span> + <span style='color:#010001'>prec</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#2B91AF'>MgWktReaderWriter</span><span
style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#010001'>wktReaderWriter</span>
= <span style='color:blue'>new</span> <span style='color:#2B91AF'>MgWktReaderWriter</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#2B91AF'>MgGeometry</span><span
style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#010001'>geometry</span>
= <span style='color:#010001'>wktReaderWriter</span>.<span style='color:#010001'>Read</span>(<span
style='color:#A31515'>"POLYGON XY (("</span> + <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
<span style='color:#010001'>d11</span>.<span style='color:#010001'>ToString</span>()
+ <span style='color:#A31515'>" "</span> + <span style='color:#010001'>d12</span>.<span
style='color:#010001'>ToString</span>() + <span style='color:#A31515'>",
"</span> +<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
<span style='color:#010001'>d21</span>.<span style='color:#010001'>ToString</span>()
+ <span style='color:#A31515'>" "</span> + <span style='color:#010001'>d22</span>.<span
style='color:#010001'>ToString</span>() + <span style='color:#A31515'>",
"</span> +<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
<span style='color:#010001'>d31</span>.<span style='color:#010001'>ToString</span>()
+ <span style='color:#A31515'>" "</span> + <span style='color:#010001'>d32</span>.<span
style='color:#010001'>ToString</span>() + <span style='color:#A31515'>",
"</span> +<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
<span style='color:#010001'>d41</span>.<span style='color:#010001'>ToString</span>()
+ <span style='color:#A31515'>" "</span> + <span style='color:#010001'>d42</span>.<span
style='color:#010001'>ToString</span>() + <span style='color:#A31515'>",
"</span> +<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
<span style='color:#010001'>d11</span>.<span style='color:#010001'>ToString</span>()
+ <span style='color:#A31515'>" "</span> + <span style='color:#010001'>d12</span>.<span
style='color:#010001'>ToString</span>() + <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
<span style='color:#A31515'>"))"</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#010001'>Query</span><span style='font-size:
10.0pt;font-family:"Courier New"'>.<span style='color:#010001'>SetSpatialFilter</span>(<span
style='color:#A31515'>"Geometry"</span>, <span style='color:#010001'>geometry</span>,
<span style='color:#2B91AF'>MgFeatureSpatialOperations</span>.<span
style='color:#010001'>Intersects</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:#2B91AF'>MgResourceIdentifier</span><span
style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#010001'>ResId</span>
= <span style='color:blue'>new</span> <span style='color:#2B91AF'>MgResourceIdentifier</span>(<span
style='color:#2B91AF'>„FeatureSource“</span>);<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:#2B91AF'>MgFeatureReader</span><span style='font-size:10.0pt;font-family:
"Courier New"'> <span style='color:#010001'>fReader</span> = <span
style='color:#010001'>featureService</span>.<span style='color:#010001'>SelectFeatures</span>(<span
style='color:#010001'>LeidimuResId</span>, „FeatureName“, <span
style='color:#010001'>Query</span>);<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>fReader.Close();<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal>After calling this couple hundred times, i get this error in
MapGuide error log: <o:p></o:p></p>
<p class=MsoNormal>Error: Out of memory.<o:p></o:p></p>
<p class=MsoNormal> bad allocation<o:p></o:p></p>
<p class=MsoNormal>In process manager i can see that after each call
mapguide.exe process is using more and more memory.<o:p></o:p></p>
<p class=MsoNormal>Is this a bug or i am doing something wrong?<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thanks.<o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
</div>
</body>
</html>