Reputation: 1258
I have approximately 12,000 records.
In one of my workflow activities, I interate through all 12,000 records and manually call another Activity on each record.
The line looks like:
IDictionary<string, object> results = WorkflowInvoker.Invoke(childActivity, args);
On about the 11,500th record, I get AccessViolationException with the message that I've reached protected memory.
I can see the memory consumption rising in the Task Manager's Performance tab.
How do I keep the above code from increasing memory on each record interation ultimately conserving memory?
Thanks, Joshua
Upvotes: 0
Views: 158
Reputation:
You're invoking a brand new workflow within a different workflow?
Ditch this. Create a NativeActivity and within the Execute method schedule your child Activity (that workflow) using NativeActivityContext.ScheduleFunc. In the callback, do what you need to with the result and then schedule the next record.
Upvotes: 1