Hi - I'm noticing that if I create an object derived from CoreObjectsBase such as FeatureClassDefinition (via FeatureClass.GetDefinition()), and I call Dispose() on it when I'm done, its memory is released if working on a File Geodatabase. However, the memory is not released (tested in ArcGIS 3.3) if working on a SDE geodatabase (oracle in my case). Has anyone observed this? And if so, is this a bug and/or is there a way to overcome this?
Thanks,
Martin
@MartinTyberg , Have you reviewed the conceptual doc describing how Pro SDK handles the resources? Your code might unintentionally acquires Core.Data instances . Could you share your code snippet?
Hi Aashis,
Thank you for your response. I've read the conceptual document before and have been careful to follow its guidelines. Here is my code snippet that leaks for an SDE db (Oracle) but not for a file gdb:
FeatureLayer featureLayer = m_mapView.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().Where(layer => layer.Name == mapLayer.Name).FirstOrDefault();
using (FeatureClass featureClass = featureLayer.GetFeatureClass())
{
using (FeatureClassDefinition featureClassDefinition = featureClass.GetDefinition())
{
if (featureClassDefinition.GetShapeType() == ArcGIS.Core.Geometry.GeometryType.Multipoint)
{
//do something
}
}
}