[mapguide-users] featureService.SelectFeatures and memory consumption

Vaidas Velutis vaidas at infoera.lt
Mon Aug 16 06:57:02 EDT 2010


Hello, I have found that after calling featureService.SelectFeatures ,
memory is not realeased. Here is my source code:

 

MgUserInformation userInfo = new MgUserInformation("Adminitrator", "admin");

MgSiteConnection siteConnection = new MgSiteConnection();

siteConnection.Open(userInfo);

MgFeatureService featureService =
(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService)
;

MgFeatureQueryOptions Query = new MgFeatureQueryOptions();

                

double d11 = X - prec;

double d12 = Y - prec;

double d21 = X + prec;

double d22 = Y - prec;

double d31 = X + prec;

double d32 = Y + prec;

double d41 = X - prec;

double d42 = Y + prec;

 

MgWktReaderWriter wktReaderWriter = new MgWktReaderWriter();

MgGeometry geometry = wktReaderWriter.Read("POLYGON XY ((" + 

                    d11.ToString() + " " + d12.ToString() + ", " +

                    d21.ToString() + " " + d22.ToString() + ", " +

                    d31.ToString() + " " + d32.ToString() + ", " +

                    d41.ToString() + " " + d42.ToString() + ", " +

                    d11.ToString() + " " + d12.ToString() + 

                    "))");

Query.SetSpatialFilter("Geometry", geometry,
MgFeatureSpatialOperations.Intersects);

MgResourceIdentifier ResId = new MgResourceIdentifier("FeatureSource");

MgFeatureReader fReader = featureService.SelectFeatures(LeidimuResId,
"FeatureName", Query);

fReader.Close();

 

After calling this couple hundred times, i get this error in MapGuide error
log: 

Error: Out of memory.

        bad allocation

In process manager i can see that after each call mapguide.exe process is
using more and more memory.

Is this a bug or i am doing something wrong?

 

Thanks.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20100816/7bcf7cb3/attachment.html


More information about the mapguide-users mailing list