<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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:12.0pt;
        font-family:"Times New Roman","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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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 style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thanks for sharing, but this does not help i even cant see
difference that it would use less memory </span><span style='font-size:11.0pt;
font-family:Wingdings;color:#1F497D'>L</span><span style='font-size:11.0pt;
font-family:"Calibri","sans-serif";color:#1F497D'> memory increases only then
when i call selectfeatures, use of other mapguide objects does not increase memory
so i think Garbage Collector does its job good. Mayby this is FDO provider bug?<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>Pietro
Ianniello<br>
<b>Sent:</b> Tuesday, August 17, 2010 12:47 PM<br>
<b>To:</b> MapGuide Users Mail List<br>
<b>Subject:</b> Re: [mapguide-users] RE: featureService.SelectFeatures and
memory consumption<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>You should try to dispose every mapguide object.<br>
I have written the following simple class not to forget any object:<br>
<br>
<span style='font-family:"Courier New"'>---------------------------------</span><br>
<span style='font-family:"Courier New"'>using System;<br>
using System.Collections.Generic;<br>
using System.Linq;<br>
using System.Text;<br>
<br>
namespace MapGuideHelpers<br>
{<br>
//Class T[o]B[e]Disposed<br>
public class MGDisposable<U> : IDisposable where U :
OSGeo.MapGuide.MgDisposable<br>
{<br>
U _val;<br>
public U Get { get { return _val; }
}<br>
<br>
MGDisposable(U val)<br>
{<br>
_val = val;<br>
}<br>
<br>
public static implicit operator
MGDisposable<U>(U uvar)<br>
{<br>
return new
MGDisposable<U>(uvar);<br>
}<br>
public static explicit operator
U(MGDisposable<U> mgtbdvar)<br>
{<br>
return mgtbdvar._val;<br>
}<br>
<br>
#region disposing interface<br>
<br>
public void Dispose()<br>
{<br>
this.Dispose(true);<br>
GC.SuppressFinalize(this);<br>
}<br>
<br>
~MGDisposable()<br>
{<br>
this.Dispose(false);<br>
}<br>
<br>
protected virtual void Dispose(bool
disposing)<br>
{<br>
if (null !=
_val)<br>
{<br>
_val.Dispose();<br>
}<br>
}<br>
<br>
#endregion<br>
}<br>
}<br>
---------------------------------</span><br>
<br>
<span style='font-family:"Arial","sans-serif"'>Now you can:<br>
<br>
using
(MGDisposable<MgMAPGUIDECLASS> mgObj = <GET THE OBJECT UING
MAPGUIDE>)<br>
{<br>
<br>
}<br>
<br>
and the use mgObj:<br>
mgObj.Get.<METHOD>()<br>
or<br>
((MgMAPGUIDECLASS)mgObj).<METHOD>()<br>
<br>
Example:<br>
<br>
</span><span style='font-family:"Courier New"'>
using (MGDisposable<MgLayerBase> layer = layerCollection.GetItem(i))<br>
{<br>
using (MGDisposable<MgResourceIdentifier> layerDefinition = <i>layer.Get</i>.GetLayerDefinition())<br>
{<br>
//...<br>
}<br>
}</span><span
style='font-family:"Arial","sans-serif"'><br>
Or:<br>
</span><span style='font-family:"Courier New"'>
using (MGDisposable<MgLayerBase> layer = layerCollection.GetItem(i))<br>
{<br>
using (MGDisposable<MgResourceIdentifier> layerDefinition = <br>
<i>((MgLayerBase)layer)</i>.GetLayerDefinition())<br>
{<br>
//...<br>
}<br>
}</span><span
style='font-family:"Arial","sans-serif"'><br>
</span><br>
<span style='font-family:"Arial","sans-serif"'><br>
Pietro Ianniello</span><o:p></o:p></p>
</div>
</body>
</html>