Forget about releasing an IFeature
inside the loop. You can only find performance issues doing that. So I wouldn't recommend to release an IFeature
object inside a loop. As Michael says, the objects gets overwritten as the next feature is called.
Also an IFeature
object isn't necessary to be released (see ESRI documentation about realising in ArcObjects).
I, following ESRI recommendations, release objects that implement ICursors, IEnums and ISets when I've finished to used them.
You are also free to release an IRow
or IFeature
object, but IMHO don't see that necessary.
BTW: A paragraph about recycling and no recycling cursors in ArcObjects (more info here):
Non-recycling feature cursors returned from the Search method MUST be used when copying features from the cursor into an insert cursor of another class. This is because a recycling cursor reuses the same geometry and under some circumstances all of the features inserted into the insert cursor may have the same geometry. Using a non-recycling cursor ensures that each geometry is unique.