Memory leak with org.tmatesoft.svn

View: New views
3 Messages — Rating Filter:   Alert me  

Memory leak with org.tmatesoft.svn

by Zsolt Koppany :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It appears the org.tmatesoft.svn package causes a memory leak. All
SVNClientManager instances incl. all referenced objects stay in memory even
after all references by our application have been garbage collected.
 
Our code basically looks like this:
 
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
options.setAuthStorageEnabled(false);


SVNClientManager clientManager = SVNClientManager.newInstance(options, new
BasicAuthenticationManager(user, password));

SVNRepository svnRepository =
clientManager.createRepository(SVNURL.parseURIDecoded(url), false);

SVNLogClient logClient = clientManager.getLogClient();

logClient.doLog(...);

How can we fix the problem? We use svnkit-1.1.4.3622.
 
Heap dump:
 
Class
#instances
======================================================================
 
class org.tmatesoft.svn.core.auth.BasicAuthenticationManager       965
class org.tmatesoft.svn.core.SVNURL
1321
class org.tmatesoft.svn.core.internal.io.fs.FSRepository                 643
class org.tmatesoft.svn.core.internal.wc.SVNConfigFile               1930
class org.tmatesoft.svn.core.internal.io.fs.FSFS
643
class org.tmatesoft.svn.core.auth.SVNSSHAuthentication              965
class org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool          965
class org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool$TimeoutTask     965

class org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions         965
class org.tmatesoft.svn.core.internal.wc.admin.SVNEntry            1778
class org.tmatesoft.svn.core.internal.io.fs.FSUpdateContext          315
class org.tmatesoft.svn.core.io.diff.SVNDiffInstruction               1651
class org.tmatesoft.svn.core.internal.delta.SVNRangeTree$SVNRangeTreeNode
614
class [Lorg.tmatesoft.svn.core.io.diff.SVNDiffInstruction;             315
class org.tmatesoft.svn.core.wc.SVNClientManager                      315
class org.tmatesoft.svn.core.internal.wc.SVNUpdateEditor            315
class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea14 315
class org.tmatesoft.svn.core.internal.delta.SVNDeltaCombiner      315
class org.tmatesoft.svn.core.auth.SVNPasswordAuthentication      965
class org.tmatesoft.svn.core.auth.SVNUserNameAuthentication    965
class org.tmatesoft.svn.core.internal.wc.SVNCompositeConfigFile 965
class org.tmatesoft.svn.core.internal.delta.SVNVDeltaAlgorithm   315
class org.tmatesoft.svn.core.wc.SVNUpdateClient                        315
class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea14$1 315
class org.tmatesoft.svn.core.internal.delta.SVNRangeTree             315
class org.tmatesoft.svn.core.internal.delta.SVNXDeltaAlgorithm     315
class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaInfo 315
class org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess      315
class org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator                 315
class org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor      315
class org.tmatesoft.svn.core.internal.delta.SVNDeltaCombiner$SVNOffsetsIndex
315
class org.tmatesoft.svn.core.io.diff.SVNDeltaProcessor                 315



Parent Message unknown Re: Memory leak with org.tmatesoft.svn

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Zsolt,

I will check that issue, meanwhile please make sure that you call
SVNClientManager.dispose() when you no longer need it.

However, there should not be references to SVNUpdateEditor and related
classes unless "update" (checkout, diff, switch, status...) operation is
running. There are not static fields these objects could be referenced
by, so please also check that you have no background "update" operation
running.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!

Zsolt Koppany wrote:

> It appears the org.tmatesoft.svn package causes a memory leak. All
> SVNClientManager instances incl. all referenced objects stay in memory even
> after all references by our application have been garbage collected.
>  
> Our code basically looks like this:
>  
> ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
> options.setAuthStorageEnabled(false);
>
>
> SVNClientManager clientManager = SVNClientManager.newInstance(options, new
> BasicAuthenticationManager(user, password));
>
> SVNRepository svnRepository =
> clientManager.createRepository(SVNURL.parseURIDecoded(url), false);
>
> SVNLogClient logClient = clientManager.getLogClient();
>
> logClient.doLog(...);
>
> How can we fix the problem? We use svnkit-1.1.4.3622.
>  
> Heap dump:
>  
> Class
> #instances
> ======================================================================
>  
> class org.tmatesoft.svn.core.auth.BasicAuthenticationManager       965
> class org.tmatesoft.svn.core.SVNURL
> 1321
> class org.tmatesoft.svn.core.internal.io.fs.FSRepository                 643
> class org.tmatesoft.svn.core.internal.wc.SVNConfigFile               1930
> class org.tmatesoft.svn.core.internal.io.fs.FSFS
> 643
> class org.tmatesoft.svn.core.auth.SVNSSHAuthentication              965
> class org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool          965
> class org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool$TimeoutTask     965
>
> class org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions         965
> class org.tmatesoft.svn.core.internal.wc.admin.SVNEntry            1778
> class org.tmatesoft.svn.core.internal.io.fs.FSUpdateContext          315
> class org.tmatesoft.svn.core.io.diff.SVNDiffInstruction               1651
> class org.tmatesoft.svn.core.internal.delta.SVNRangeTree$SVNRangeTreeNode
> 614
> class [Lorg.tmatesoft.svn.core.io.diff.SVNDiffInstruction;             315
> class org.tmatesoft.svn.core.wc.SVNClientManager                      315
> class org.tmatesoft.svn.core.internal.wc.SVNUpdateEditor            315
> class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea14 315
> class org.tmatesoft.svn.core.internal.delta.SVNDeltaCombiner      315
> class org.tmatesoft.svn.core.auth.SVNPasswordAuthentication      965
> class org.tmatesoft.svn.core.auth.SVNUserNameAuthentication    965
> class org.tmatesoft.svn.core.internal.wc.SVNCompositeConfigFile 965
> class org.tmatesoft.svn.core.internal.delta.SVNVDeltaAlgorithm   315
> class org.tmatesoft.svn.core.wc.SVNUpdateClient                        315
> class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea14$1 315
> class org.tmatesoft.svn.core.internal.delta.SVNRangeTree             315
> class org.tmatesoft.svn.core.internal.delta.SVNXDeltaAlgorithm     315
> class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaInfo 315
> class org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess      315
> class org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator                 315
> class org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor      315
> class org.tmatesoft.svn.core.internal.delta.SVNDeltaCombiner$SVNOffsetsIndex
> 315
> class org.tmatesoft.svn.core.io.diff.SVNDeltaProcessor                 315
>
>
>

RE: Memory leak with org.tmatesoft.svn

by Zsolt Koppany :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alexander,

> However, there should not be references to SVNUpdateEditor and related
> classes unless "update" (checkout, diff, switch, status...) operation is
> running. There are not static fields these objects could be referenced
> by, so please also check that you have no background "update" operation
> running.

The attached code is just an example, it doesn't contain the entire code
used in the application.

Zsolt

> Alexander Kitaev,
> TMate Software,
> http://svnkit.com/ - Java [Sub]Versioning Library!
>
> Zsolt Koppany wrote:
> > It appears the org.tmatesoft.svn package causes a memory leak. All
> > SVNClientManager instances incl. all referenced objects stay in memory
> even
> > after all references by our application have been garbage collected.
> >
> > Our code basically looks like this:
> >
> > ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
> > options.setAuthStorageEnabled(false);
> >
> >
> > SVNClientManager clientManager = SVNClientManager.newInstance(options,
> new
> > BasicAuthenticationManager(user, password));
> >
> > SVNRepository svnRepository =
> > clientManager.createRepository(SVNURL.parseURIDecoded(url), false);
> >
> > SVNLogClient logClient = clientManager.getLogClient();
> >
> > logClient.doLog(...);
> >
> > How can we fix the problem? We use svnkit-1.1.4.3622.
> >
> > Heap dump:
> >
> > Class
> > #instances
> > ======================================================================
> >
> > class org.tmatesoft.svn.core.auth.BasicAuthenticationManager       965
> > class org.tmatesoft.svn.core.SVNURL
> > 1321
> > class org.tmatesoft.svn.core.internal.io.fs.FSRepository
> 643
> > class org.tmatesoft.svn.core.internal.wc.SVNConfigFile
> 1930
> > class org.tmatesoft.svn.core.internal.io.fs.FSFS
> > 643
> > class org.tmatesoft.svn.core.auth.SVNSSHAuthentication              965
> > class org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool          965
> > class org.tmatesoft.svn.core.wc.DefaultSVNRepositoryPool$TimeoutTask
> 965
> >
> > class org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions         965
> > class org.tmatesoft.svn.core.internal.wc.admin.SVNEntry            1778
> > class org.tmatesoft.svn.core.internal.io.fs.FSUpdateContext          315
> > class org.tmatesoft.svn.core.io.diff.SVNDiffInstruction
> 1651
> > class
> org.tmatesoft.svn.core.internal.delta.SVNRangeTree$SVNRangeTreeNode
> > 614
> > class [Lorg.tmatesoft.svn.core.io.diff.SVNDiffInstruction;
> 315
> > class org.tmatesoft.svn.core.wc.SVNClientManager
> 315
> > class org.tmatesoft.svn.core.internal.wc.SVNUpdateEditor            315
> > class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea14 315
> > class org.tmatesoft.svn.core.internal.delta.SVNDeltaCombiner      315
> > class org.tmatesoft.svn.core.auth.SVNPasswordAuthentication      965
> > class org.tmatesoft.svn.core.auth.SVNUserNameAuthentication    965
> > class org.tmatesoft.svn.core.internal.wc.SVNCompositeConfigFile 965
> > class org.tmatesoft.svn.core.internal.delta.SVNVDeltaAlgorithm   315
> > class org.tmatesoft.svn.core.wc.SVNUpdateClient
> 315
> > class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea14$1 315
> > class org.tmatesoft.svn.core.internal.delta.SVNRangeTree             315
> > class org.tmatesoft.svn.core.internal.delta.SVNXDeltaAlgorithm     315
> > class org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaInfo 315
> > class org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess      315
> > class org.tmatesoft.svn.core.io.diff.SVNDeltaGenerator
> 315
> > class org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor      315
> > class
> org.tmatesoft.svn.core.internal.delta.SVNDeltaCombiner$SVNOffsetsIndex
> > 315
> > class org.tmatesoft.svn.core.io.diff.SVNDeltaProcessor
> 315
> >
> >
> >