You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gary Larsen <ga...@envisn.com> on 2006/01/12 20:43:45 UTC

Memory leak scheduling job from java

I'm using Cocoon 2.1.7 and have set up a schedule to run every minute by
setting up a trigger in cocoon.xconf:

 <trigger name="com.envisn.nv.config.ConfigurationManager"
          target="com.envisn.nv.config.ConfigurationManager"
          concurrent-runs="false">
    <cron>0 0/1 * * * ? *</cron>  <!-- every minute -->
 </trigger>


The trigger executes a class that manages the scheduling of a job, and if it
needs to, it adds a new entry:

  JobScheduler scheduler =
          (JobScheduler)this.manager.lookup(JobScheduler.ROLE);

  SynchronizerDaemon daemon = createSynchronizerDaemon(context);
  scheduler.addPeriodicJob(SynchronizerDaemon.class.getName(),  
          daemon, minutes, false, null, null);



The job runs on schedule perfectly but there appears to a problem with the
job execution releasing resources.  Each run of the job adds to the memory
consumption and eventually will create an out of memory error.

I tried to track down the memory leak with JProfiler.  I had the app run the
job only once and after execution the resources that were created when the
job started still exist.  Here are a few lines from the allocation call tree
that was created from the job:

  80.6% - 44,761 kB - 661,134 alloc.    
      EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
   80.5% - 44,738 kB - 660,138 alloc. 
       org.quartz.core.JobRunShell.run
    79.9% - 44,375 kB - 654,219 alloc.
        com.envisn.nv.sync.SynchronizerDaemonImpl.execute
     79.9% - 44,375 kB - 654,219 alloc. 
       com.envisn.nv.sync.SynchronizerDaemonImpl.doActiveSync


I tried 'scheduler.removeJob(jobName)' to see if that would free resources
without any effect.

Is there something else that needs to be done to have these resources
released?

Thanks for any advice,
Gary


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org