[fdo-users] Re: Memory issue with FDO IInsert and workaround

Romica Dascalescu Romica.Dascalescu at autodesk.com
Tue Apr 10 10:08:34 EDT 2012


Hi Ray,

You should use the insert command like below:

using (FdoIFeatureReader fdoReader=IInsertCmd.Execute())
{
   fdoReader.Close();
}

Moreover in your code you should avoid calling FDO objects like:
FdoObj.Acollection.Add(*);
You should use it liek below:
collection = FdoObj.Acollection
collection.Add(*);

You can also try to call Dispose (or add using blocks) on new FDO objects to avoid GC to free them when is too late.

Regards,
Romy
________________________________________
From: fdo-users-bounces at lists.osgeo.org [fdo-users-bounces at lists.osgeo.org] on behalf of Ray [ray.wu at efacec.com]
Sent: Tuesday, April 10, 2012 9:54 AM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] Re: Memory issue with FDO IInsert and workaround

Thanks Jackie for your input.

For #1: I simply call the following to do the insertion:
IInsertCmd.Execute().
Instead of the above, should I do the following?
IInsertCmd.Execute()
fdoReader.close()
Btw, I reuse the same IInsertCmd for all the insertions.

For #2, I use the former approach because I have to insert for a number of
featureclasses and each of them have a dozen of properties. Instead of
caching all the propertyvalues for each the featureclasses which will be
hundred of propertyvalues in total, I wrote some generic code (a dozen lines
of code) which works for all feature classes. So I did new propertyvalue for
each record, but I dispose them after each insertion.

So FDO can not use fragmented memory? I called ODP.net which doesn't seem to
be a problem.

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Memory-issue-with-FDO-IInsert-and-workaround-tp4717196p4752522.html
Sent from the FDO Users mailing list archive at Nabble.com.
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users


More information about the fdo-users mailing list