Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3008

Memory leak due to TransactionContext and java.util.Timer

    XMLWordPrintableJSON

Details

    Description

      When working on large write operations, instances of TransactionContext may stay referenced by an instance of java.util.TaskQueue long after the task has been cancelled

      In TransactionContext.prepare() the rollback task is scheduled :
      timer.schedule(this, timeout * 1000, Integer.MAX_VALUE);

      In java.util.Timer looking at TimerThread.mainLoop() since the period is set to Integer.MaxValue and recurrent tasks are in the queue, the task may stay in the queue a lot longer than expected. This can lead to OutOfMemory errors.

      The org.apache.jackrabbit.util.Timer could be modified to add a method to schedule tasks without period.
      Or a call to Timer.purge() could be made in org.apache.jackrabbit.util.Task.cancel()

      What do you think?

      Attachments

        Activity

          People

            Unassigned Unassigned
            tonio Antoine Brochard
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: