10 Replies Latest reply on Sep 12, 2007 8:37 AM by estaub

    java.lang.OutOfMemoryError

      hi !!

      I've a big problem... I use jbpm to create an application witch using workflow.

      I deploy my app on weblogic server (in Vignette portal) and oracle. All my application work fine and jBPM to.

      However, when I devellope my app, I always change de classe of portlets and weblogic must to redeploy application... The problem is that when weblogic deploy application, java take 2MB in mémory. After some redepoyment, "java.lang.OutOfMemoryError"...

      What do you think about this problem ??

        • 1. Re: java.lang.OutOfMemoryError
          kukeltje

          2MB? Does not sound as a problem to me. Besides that, why do you think this is a jBPM issue

          • 2. Re: java.lang.OutOfMemoryError

            2MB, it not a problem, the problem is that each time weblogic redeploy my app, 2MB add to the java memory allocation...

            So, after 50 redeployment, I've 100 MB... And I think the problem come from jbpm because with the others app that I'd develloped, I've never had this problem !

            • 3. Re: java.lang.OutOfMemoryError
              kukeltje

              did you use jsf before? Some appservers keep a lock on some jsf jar afaik and keep it in memory, or if some threads are still running...

              • 4. Re: java.lang.OutOfMemoryError

                A wild guess.... might somehow calling JbpmConfiguration.close() help? That would free up the JobExecutor threads, servicefactories, etc.

                I don't know enough about WebLogic redeployment to know whether it would make a difference.

                -Ed Staub

                • 5. Re: java.lang.OutOfMemoryError

                  Ok,

                  When I remove the jobExecutor Servlet declaration from the web.xml file :


                  <servlet-name>JobExecutorServlet</servlet-name>
                  <servlet-class>org.jbpm.job.executor.JobExecutorServlet</servlet-class>
                  <load-on-startup>1</load-on-startup>


                  <servlet-mapping>
                  <servlet-name>JobExecutorServlet</servlet-name>
                  <url-pattern>/jobs</url-pattern>
                  </servlet-mapping>

                  It work fine, thanks... But now, does the jobExecutor work ?? How can I make to run jobExecutor without servlet ?

                  • 6. Re: java.lang.OutOfMemoryError
                    kukeltje

                    file a jira issue that the jobExecutor is stopped when an undeploy takes place.

                    • 7. Re: java.lang.OutOfMemoryError

                      I'm not sure, but I don't think the servlet is required for JobExecutor - it only provides a way to monitor, I think.
                      The only thing I'm missing is that I don't see where JobExecutor.start() is called if the servlet isn't included.

                      • 8. Re: java.lang.OutOfMemoryError

                        I don't know... But I've a bad news !!

                        In fact, the problem isn't solved... I think he problem come from JbpmConfiguration... In my portlet, I've this :

                        
                        public class Portlet extends GenericPortlet {
                        
                         static public JbpmConfiguration jbpmconf = null;
                        
                         public Portlet() {
                         }
                        
                         public void init(PortletConfig config) throws PortletException {
                         super.init(config);
                         jbpmconf = JbpmConfiguration.getInstance();
                         }
                        
                         public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
                         {
                         PortletMode mode = request.getPortletMode();
                         if(mode.equals(PortletMode.VIEW))
                         doViewAction(request,response);
                         }
                        
                         public void doViewAction (ActionRequest request, ActionResponse response) throws PortletException, IOException
                         {
                         JbpmContext jbpmContext = jbpmconf.createJbpmContext();
                        
                         try {
                         ... my code ...
                        
                         finally {
                         jbpmContext.close();
                         }
                         }
                        
                         public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
                        
                         JbpmContext jbpmContext = jbpmconf.createJbpmContext();
                        
                         try {
                         ... my code ...
                         }
                         finally {
                         jbpmContext.close();
                         }
                        }
                        
                         public void destroy() {
                         jbpmconf.close();
                         }
                        }
                        


                        When I change code of my portlet, the portlet container rebuild the portlet and reload jbmpConfiguration... But I don't undersatnd, the old jbpmconfig is staying in mémory...

                        So, if I put the jbpm lib in the server classpath, all is ok, beacause it always keep the jbpmConfiguration in mémory.

                        SomeOne has any idea to keep the jbpm lib in my WEB-INF lib without outOfMemory error ?? thanks !

                        • 9. Re: java.lang.OutOfMemoryError

                          You can use exetrnal classes that load / unload the jbpm configuration. Make those classes static and initialize the jBPM configuration only when it's null. I hope this helps

                          • 10. Re: java.lang.OutOfMemoryError

                            How are you observing that the old jbpmConfig is staying in memory?