[RFC] Out of memory during BzrDir.find_branches

Jonathan Lange jml at mumak.net
Mon Apr 21 01:45:04 BST 2008


On Mon, Apr 21, 2008 at 10:34 AM, Andrew Bennetts <andrew at canonical.com> wrote:
> Jonathan Lange wrote:
>  > Hello,
>  >
>  > I was doing some work on the bzr-removable plugin yesterday, and was
>  > having some problems with BzrDir.find_branches. Specifically, when I
>  > run it on one of my other projects it takes a while, chews up CPU and
>  > memory and then raises an out-of-memory error.
>
>  I get that with the bzr-svn plugin installed, and otherwise it's fine.  It seems
>  to be a memory leak that happens with *some* combinations of bzr-svn and the
>  python subversion bindings (but not all).
>

Even when there is no Subversion involved? Curious.

>  > Taking a peak at the implementation, I notice that it builds all of
>  > the open branches into a big list. This seems bound to cause problems.
>  > Would it be a good thing to make BzrDir.find_branches an iterator?
>  >
>  > I can imagine that there are other, deeper memory consumption issues
>  > at play here. Still, making find_branches an iterable means that
>  > bzr-removable could use it.
>
>  See:
>  http://bundlebuggy.aaronbentley.com/request/%3C20080408013939.GA16870@steerpike.home.puzzling.org%3E
>
>  I think to address Robert's concerns about that branch, I should add a test to
>  make sure that interleaving other operations with iterating the find_branches
>  iterator works correctly.  If necessary I'd also explicitly use "return
>  list(...)" in RemoteBzrDir.find_branches to make that test pass.

That's not enough info for me to code it, I'm afraid. "other
operations" and "works correctly" aren't all that specific. ;)

jml



More information about the bazaar mailing list