locked
Clearing WF instances? RRS feed

  • Question

  • Hi,

    I have been creating lot of WF instances, and now im running of memory after running the program for 15 min or so.

    Is there any way to clean up the resources in Workflow Application Completed method?

    Friday, August 27, 2010 1:57 PM

Answers

  • Hi,

    A direct way to Enable GC: set WfApp=null;
    You can just treate WorklfowApplication object as a normal .net object. and apply .net GC to clean the objects.

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com
    • Marked as answer by WMeher Tuesday, August 31, 2010 3:09 PM
    Tuesday, August 31, 2010 8:47 AM

All replies

  • On Completed event can we call WorkflowApplication.EndRun() or Unload() methods to clear the instances and remove the used resources?
    Friday, August 27, 2010 2:13 PM
  • Any suggestions are welcome!

    I have tried Unload method in completed event, but getting runtime error. Stating WF cant be completed.

    So how to clear up the instances once they are finished processing?

    Friday, August 27, 2010 5:14 PM
  • I have used Unload method in WorkflowApplication completed event. Didnt work for me. Also tried with

    Terminate method. Neither worked for me.

     

    Friday, August 27, 2010 8:56 PM
  • Hi,

    A direct way to Enable GC: set WfApp=null;
    You can just treate WorklfowApplication object as a normal .net object. and apply .net GC to clean the objects.

    Regards
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com
    • Marked as answer by WMeher Tuesday, August 31, 2010 3:09 PM
    Tuesday, August 31, 2010 8:47 AM
  • HI,

    I have set WfApp = null in completed delegate of Workflowapplication.

    By doing this, I have increased suporting instances by 2 times. Is still there a way, to support my required instances may be like 40000 instances?

    Tuesday, August 31, 2010 3:15 PM
  • Hi,

    You should set WfApp=null in Unloaded Action instead of Completed.
    This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support. My Blog:http://xhinker.com
    Wednesday, September 1, 2010 1:21 AM
  • Hi,

    I set WfApp = null in Unloaded Action, there is no change. I posted my code at skydrive

    http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/354144a2-7f5a-4f9a-b4d4-36501cc60b2b

    Could you please take a look. Some how I need to speed up the WF process.

    For running 7k records and doing some logic, my WF is taking like 9 minutes.

    If I do the same in C# code, it is taking like 5 seconds. Can we ,make WF processing speed up?

    Wednesday, September 1, 2010 9:57 PM