I also face similar situation when i was updating entire feature class and i notice that arcFM autoupdators causing the memory leak.
while ((fcDeviceGroup = featureCursor.NextFeature()) != null)
{
long mem1 = GC.GetTotalMemory(true);
_log.Debug("Memory Before " + mem1);
Debug.Print("Memory Before {0}", mem1);
processed++;
Console.WriteLine("Processing " + processed + " in total features: " + count);
if (!indexStrc)
{
structureGuid = fcDeviceGroup.Fields.FindField("globalid");
}
STRUCTUREGUID = Convert.ToString(fcDeviceGroup.get_Value(structureGuid));
GetOpenPointDictionary(STRUCTUREGUID, openPoint, checkStatus, busBar, ref indexSet, ref indexOpVolt);
Marshal.FinalReleaseComObject(fcDeviceGroup);
long mem2 = GC.GetTotalMemory(true);
Debug.Print("Memory After {0}", mem2);
Debug.Print("Difference {0}", mem1 - mem2);
_log.Debug("Memory After " + mem2);
_log.Debug("Difference " + Convert.ToString(mem1 - mem2));
}
if (featureCursor != null)
{
while (Marshal.FinalReleaseComObject(featureCursor) > 0) { }
}
This is code i was using to check for memory leak. When autoupdors was enable then every iteration memory sampling was.
2014-09-19 10:28:02,764 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 863664
2014-09-19 10:28:02,764 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:02,777 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 863804
2014-09-19 10:28:03,532 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864196
2014-09-19 10:28:03,936 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory Update Operation****************** 864508
2014-09-19 10:28:03,938 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - ****************Difference 312
2014-09-19 10:28:03,946 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 863940
2014-09-19 10:28:03,946 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference -136
2014-09-19 10:28:03,962 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 863920
2014-09-19 10:28:04,180 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 863960
2014-09-19 10:28:04,199 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 863876
2014-09-19 10:28:04,200 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 44
2014-09-19 10:28:04,212 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864016
2014-09-19 10:28:04,702 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864348
2014-09-19 10:28:05,052 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory Update Operation****************** 864656
2014-09-19 10:28:05,055 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - ****************Difference 308
2014-09-19 10:28:05,063 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864156
2014-09-19 10:28:05,063 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference -140
2014-09-19 10:28:05,070 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864136
2014-09-19 10:28:05,957 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864624
2014-09-19 10:28:06,287 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory Update Operation****************** 864936
2014-09-19 10:28:06,288 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - ****************Difference 312
2014-09-19 10:28:06,291 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864376
2014-09-19 10:28:06,291 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference -240
2014-09-19 10:28:06,300 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864356
2014-09-19 10:28:07,129 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864960
2014-09-19 10:28:07,585 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory Update Operation****************** 865272
2014-09-19 10:28:07,588 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - ****************Difference 312
2014-09-19 10:28:07,594 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864588
2014-09-19 10:28:07,595 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference -232
2014-09-19 10:28:07,613 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864568
2014-09-19 10:28:07,843 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:07,865 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:07,866 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 44
2014-09-19 10:28:07,878 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
2014-09-19 10:28:07,968 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:07,990 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:07,991 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:08,003 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
2014-09-19 10:28:08,101 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:08,114 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:08,115 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:08,127 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
2014-09-19 10:28:08,232 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:08,255 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:08,256 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:08,268 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
2014-09-19 10:28:08,361 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:08,380 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:08,380 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:08,393 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
2014-09-19 10:28:08,495 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:08,520 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:08,521 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:08,533 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
2014-09-19 10:28:08,638 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:08,661 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:08,661 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:08,673 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
2014-09-19 10:28:08,764 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:08,786 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:08,787 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:08,798 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
2014-09-19 10:28:08,892 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - *****************Memory After adding every thing in dictionary****************** 864608
2014-09-19 10:28:08,909 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory After 864524
2014-09-19 10:28:08,910 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Difference 140
2014-09-19 10:28:08,923 [17856] DEBUG OperatingVoltComparison.Program [(null)] <(null)> - Memory Before 864664
After disabling AU's memory consumption almost stable. For disabling AU's, I used following code.
private static mmAutoUpdaterMode EnableAutoupdaters()
{
object objAutoUpdater = null;
//Create an MMAutoupdater
objAutoUpdater = Activator.CreateInstance(Type.GetTypeFromProgID("mmGeodatabase.MMAutoUpdater"));
autoupdater = objAutoUpdater as IMMAutoUpdater;
//Save the existing mode
mmAutoUpdaterMode oldMode = autoupdater.AutoUpdaterMode;//autoupdater.AutoUpdaterMode
//Turn off autoupdater events
autoupdater.AutoUpdaterMode = mmAutoUpdaterMode.mmAUMNoEvents;//mmAutoUpdaterMode.mmAUMStandAlone
return oldMode;
}
You can call this method before doing any DML operation. I hope this will help to find the problem.