[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Subversion python bindings ignoring pool arguments?

From: Lars Gullik Bjønnes <larsbj_at_gullik.net>
Date: 2006-01-22 14:28:28 CET

larsbj@gullik.net (Lars Gullik Bjønnes) writes:

| David James <djames@collab.net> writes:
| | On 1/20/06, Christian Boos <cboos@neuf.fr> wrote:
| | > We have another issue in Trac concerning the python bindings
| | > for SVN 1.3.0.
| | >
| | > May I ask you to have a look at
| | > http://projects.edgewall.com/trac/ticket/2620
| | > and tell me what you think?
| |
| | Hi Christian,
| |
| | This looks like a Subversion 1.3 bug. In order to fix this I'll need a
| | short script which reproduces the problem. Does the script you
| | attached to the issue (check_svn_repos.py) do the trick if I run it on
| | a really big repository? See
| | http://projects.edgewall.com/trac/attachment/ticket/2620/check_svn_repos.py
| I am pretty sure that it does not since it only checks a single
| revision. I'll modify the script to run on a range of revisions and
| test that on the big repo that I have (78000 revs, 12GB)

I did that, but only setup the script to check the first 8000 revs.
Same behaviour. Memory used grows very fast. Note that
svn_repos_replay is commented out and also my earlier test shows that
it is the delta.make_editor that 'leaks' the memory.

This is what my modified script looks like:

from trac.versioncontrol.svn_fs import Pool
from trac.util import TracError
from svn import repos, fs, delta

import sys
import os

class ChangeCollectorChecker(object):
    def __init__(self, path):
        self.pool = Pool()

        # Remove any trailing slash or else subversion might abort
        path = os.path.normpath(path).replace('\\', '/')
        self.path = repos.svn_repos_find_root_path(path, self.pool())
        if self.path is None:
            raise TracError, \
                  "%s does not appear to be a Subversion repository." % path

        self.repos = repos.svn_repos_open(self.path, self.pool())
        self.fs_ptr = repos.svn_repos_fs(self.repos)

    def check(self, rev):
        pool = Pool(self.pool)
        root = fs.revision_root(self.fs_ptr, rev, pool())
        editor = repos.RevisionChangeCollector(self.fs_ptr, rev, pool())
        e_ptr, e_baton = delta.make_editor(editor, pool())
        #repos.svn_repos_replay(root, e_ptr, e_baton, pool())

if __name__ == '__main__':
        path = sys.argv[1]
        #rev = sys.argv[2]
        collector = ChangeCollectorChecker(path)
        for rev in range(8000):
                print "Checking revision %s" % rev
        import gc
        print "Checked revision %s (%d objects unreachable)" % (rev, gc.collect())
        import traceback
        print>>sys.stderr, "Usage: python check_repos.py <repository_path> <revision>"

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 22 14:29:11 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.