0
  • I use svnkit in java application to get svn revisions log, but after finish the process on the visualVm some svnkit resource and thread still exist and live .

  • ex. org.tmatesoft.svn.core.internal.util.SVNHashMap$KeyIterator, org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool$TimeoutTask

  • And when i try to log more than once it effect the application performance.

  • how can i release svnkit resources?

  • Code sample:

    public static SVNLogEntryHandler doLogFully(String[] paths, long startRevision, long endRevision, SVNRepository repository) throws SVNException {
    SVNLogEntryHandler logEntryHandler = new SVNLogEntryHandler();
    
    repository.log(paths, startRevision, endRevision, true, true, 0, false, null, logEntryHandler);
    
    return logEntryHandler;
    }
    
  • story log entry.

      for (SVNLogEntry logEntry : doLogFully(..,..,..,..,..).getLogEntries()) {
         // store log entry 
       }
    
  • Update

    • i create SVNRepository using SVNRepositoryFactory.

      SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(repositoryUrl));
          repository.setAuthenticationManager(SVNWCUtil.createDefaultAuthenticationManager(repositoryUserName, repositoryPassword));
      
Khaled Lela
  • 7,831
  • 6
  • 45
  • 73

1 Answers1

0

Run ISVNRepositoryPool#dispose on the connection pool from which you create SVNRepository instance. It will stop the timer.

See also this article for SVNKit resources releasing.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38
  • I update the question, based on the article and the update i have only to call `repository.closeSession();` to release the resources and connections.? – Khaled Lela May 21 '13 at 14:26
  • What protocol do you use? If you use svn+ssh, SVNKit keeps SSH connection open for about 10 minutes, because otherwise all operations become very slow. – Dmitry Pavlenko May 21 '13 at 15:17
  • I use svn and also try `repository.closeSession();` but visualVm still get `org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool$TimeoutTask` `org.tmatesoft.svn.core.internal.util.SVNHashMap$KeyIterator` . – Khaled Lela May 21 '13 at 16:04
  • And what SVNKit version do you use? – Dmitry Pavlenko May 21 '13 at 16:24
  • We had similar bug reports, and the problem was fixed at 1.7.6 version. Could you please try the latest SVNKit version? – Dmitry Pavlenko May 22 '13 at 14:50
  • I try svnkit-1.7.9 but i think the issue still exist, i guess i have to `repositoryPool.createRepository` instead of `SVNRepositoryFactory.create` and the `dispose` it, any way thank you for your kindly help, i will accept your answer and if you any additional information kindly update your answer. – Khaled Lela May 23 '13 at 08:46