"bzr multi-pull" consumes excessive memory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Invalid
|
Undecided
|
Unassigned | ||
Bazaar Subversion Plugin |
Fix Released
|
Low
|
Jelmer Vernooij | ||
subversion |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I have a shared repository with 6 branches under it, and a couple of non-branch directories. Running bzr multi-pull from bzr.dev in this directory eventually consumes over 1000Mb of resident memory.
Interestingly, this only occurs when the "Packaging" (directory listing attached) directory is in the current directory. When this directory exists, bzr rapidly consumes ~600MB worth of resident memory before any output is displayed (backtrace at this point attached), and then more slowly goes on to consume another 400MB or so over the rest of the operation.
It seems like there may be two bugs here: bzr multi-pull appears to have a monotone increasing memory footprint, and does something crazy when it encounters the Packaging directory.
I'm not sure what's special about the Packaging directory; I've tried making a directory with many subdirectories, a directory with many files in it, and a directory with many files containing a '~' character, and a directory containing many links, none of which seemed to cause bzr to exhibit pathological behaviour.
The packaging directory is ~100Mb, and can be provided on request, as can the entire repository+trees.
bzr version info:
Bazaar (bzr) 1.7dev
from bzr checkout /home/raof/
revision: 3664
revid: <email address hidden>
branch nick: bzr.dev
Python interpreter: /usr/bin/python 2.5.2
Python standard library: /usr/lib/python2.5
bzrlib: /home/raof/
Bazaar configuration: /home/raof/.bazaar
Bazaar log file: /home/raof/.bzr.log
Changed in bzr-svn: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in bzr-svn: | |
assignee: | nobody → jelmer |
milestone: | none → 0.5.0 |
status: | Triaged → Fix Committed |
Changed in bzr-svn: | |
status: | Fix Committed → Fix Released |
Changed in subversion: | |
status: | New → Invalid |
If I was guessing, I would say the problem is multi-pull trying to find branches that need to be synced. I believe at one point it would try to open every path that it found. It could certainly be that our Branch objects are creating a reference cycle, so they aren't getting garbage collected correctly. So having lots of files and directories is triggering the poor behavior.
A few fixes would be in order:
1) Try to make multi-pull smarter about not grabbing a branch for every object, I think there are a few valid reasons for doing so, so I would be cautions with a specific fix. (For example, you may have SVN directories and the bzr-svn plugin installed, so multi-pull would probably update them as well.)
2) Figure out why memory is increasing without being freed. Is it a reference cycle, or is it something that multi-pull is caching and not releasing.