2 Replies Latest reply on Jan 14, 2010 3:10 AM by saraswati.santanu

    Cleanup Process Engine

    tejjbpm

      Hi All,

       

      I have implemented a solution with jbpm successfully. My problem is I get a "GC overhead limit exceeded" at times as my program spends too much time on garbage collection.

       

      I think it is the way i am initialising the process engine and the clenaup is not happening properly.

       

      I do this in the beginning of each file which runs in my application

       

      processEngine

       

      = new org.jbpm.api.Configuration().setResource("my.jbpm.cfg.xml").buildProcessEngine();

       

      At the end of each file I do

       

      processEngine.close();

       

       

      But is this the correct way to do it? Do I have initialise the engine once and then use it all over the pages? Will processEngine.close() cleanup all the executionService, taskService, RepositoryService which i initalise followed by the process engine initialisation.

       

      Please guide me if there are any other better ways to do it.

       

      Thanks in advance

        • 1. Re: Cleanup Process Engine
          kukeltje
          Sounds wrong... and you already gave the solution yourself. You could just have tried this... btw, what is a file? An xhtml page? or?
          • 2. Re: Cleanup Process Engine
            saraswati.santanu
            This is wrong. You should not be creating process engine multiple times. Create the process engine, then call getExecutionService, getTaskService etc to get the individual services. Then keep those services as singleton at some central place from where you can use them. You never need to close them under normal circumstances.