Old (readonly) SVNKit Issues Tracker, new one is at http://issues.tmatesoft.com/
ATTENTION: You are browsing old (readonly) SVNKit Issues Tracker!
Please find new one at http://issues.tmatesoft.com/
If you have an account here, it should work in the new tracker as well.

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000221SVNKitbugpublic2008-02-27 01:582008-03-03 19:32
Assigned Tooka 
StatusresolvedResolutionno change required 
PlatformOSOS Version
Product Version1.1.5 
Target VersionFixed in Version1.1.x 
Summary0000221: Memory leak in svnkit.jar
DescriptionI am developer of open source continuous integration server Luntbuild. We have implemented SVN Adaptor based in svnkit.jar to log revisions and checkout source code for a project from SVN repository.
When this SVN adaptor is used, Luntbuild quite quickly (less than 24 hours) runs out of memory (using Tomcat default setting). I have profiled Luntbuild with YourKit Profiler (free for open source projects), and find out that SVN Adaptor causes the problem, attached is a zip file of the reports from the profiler. If you need to you can get source code for SvnAdaptor.java at: http://www.javaforge.com/scmShowFileRevision?proj_id=70&filename=trunk%2Fluntbuild%2Fsrc%2Fcom%2Fluntsys%2Fluntbuild%2Fvcs%2FStarteamAdaptor.java [^]

Luntbuild also supports SVN Adaptor that uses external svn executable instead of svnkit.jar, and when this svn exe adaptor is used, the memory leak goes away.

Let me know if you need more help with resolving this issue.
TagsNo tags attached.
planned for version1.2.x
Attached Fileszip file icon svnkit_memory_leak.zip [^] (14,897 bytes) 2008-02-27 01:58

- Relationships

-  Notes
oka (administrator)
2008-02-27 21:26


I've looked through SvnAdaptor code and didn't find any call to SVNClientManager dispose. In case more than one SVNAdaptor instance is used during runtime, each will have its own SVNClientManager instance which keeps timer thread (to close pooled connections on timeout).

So, I'd suggest to call SVNClientManager.dispose(). Actually you may call it after each operation in SvnAdaptor and then use the same, "disposed" SVNClientManager instance - it should work properly in this case as well.
oka (administrator)
2008-02-27 21:33

It is interesting that JavaForge uses CodeBeamer that in its turn uses SVNKit - and at some moment they've reported the same problem with SVNKit - CodeBeamer didn't call dispose properly and this caused memory leaks.
lubosp (viewer)
2008-02-27 22:26

That might be the reason for the memory leak. I did not write the but I look at the code and at svnkit examples and did not see any use of manager.dispose(). Maybe it should be highlighted in documentation and examples.

I am just rebuilding Luntbuild and will run it under profiler for aabout 24 hours and report the results.

Thanks for quick response and for your help! Lubos
lubosp (viewer)
2008-02-28 21:54

I've run Luntbuild for 24 hours with call SVNClientManager.dispose() after each SVN action (log, checkout, etc), and memory leak went away.

I would suggest to highlight the use of dispose() in documentation and in the examples.

Thanks for your help and thanks for great SVN library!

- Issue History
Date Modified Username Field Change
2008-02-27 01:58 lubosp New Issue
2008-02-27 01:58 lubosp File Added: svnkit_memory_leak.zip
2008-02-27 18:02 oka Status new => assigned
2008-02-27 18:02 oka Assigned To => oka
2008-02-27 21:26 oka Note Added: 0000406
2008-02-27 21:33 oka Note Added: 0000407
2008-02-27 22:26 lubosp Note Added: 0000409
2008-02-28 21:54 lubosp Note Added: 0000415
2008-03-03 19:32 oka planned for version => 1.2.x
2008-03-03 19:32 oka Status assigned => resolved
2008-03-03 19:32 oka Resolution open => no change required
2008-03-03 19:32 oka Fixed in Version => 1.1.x

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker