Uploaded image for project: 'Spring Batch Admin'
  1. Spring Batch Admin
  2. BATCHADM-111

removeInactiveExecutions may not be called by Scheduled Thread, causing possible out of memory

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.1
    • Component/s: Manager
    • Labels:
      None
    • Environment:
      Websphere Application Server 6.0.31

      Description

      I use the spring batch admin in production system, and find that the memory usage is slowly increase.
      Then I generated heapdump on the application server(Websphere), found that the ArrayList in SimpleJobService class contains many child, So I checked the source code and found
      @Scheduled(fixedDelay=60000L)
      public void removeInactiveExecutions()
      {
      for (Iterator iterator = this.activeExecutions.iterator(); iterator.hasNext(); ) {
      JobExecution jobExecution = (JobExecution)iterator.next();
      try

      { jobExecution = getJobExecution(jobExecution.getId()); }

      catch (NoSuchJobExecutionException e)

      { logger.error("Unexpected exception loading JobExecution", e); }

      if (!(jobExecution.isRunning()))
      iterator.remove();
      }
      }
      I guess this mean to be executed via Scheduled Thread, however I could not found any configuration xml that contains <task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>

      Also the SimpleJobService is created via SimpleJobServiceFactoryBean. So I can't see how the @Scheduled can be picked up (or may be I don't know too way about spring framework)

      I have attached a heap dump screen shot, hope is useful.

      Regards,

      Chun

        Attachments

          Activity

            People

            • Assignee:
              david_syer Dave Syer
              Reporter:
              hepoi Hepoi Ko
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: