1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-02 07:17:58 +01:00
git/perl/Git/SVN
Eric Wong dfa72fdb96 git-svn: reload RA every log-window-size
Despite attempting to use local memory pools everywhere we can,
(including our call to SVN::Ra::do_update and all subsequent reporter
calls), there does not appear to be a way to force the Git::SVN::Fetcher
callbacks to use a pool other than the per-SVN::Ra pool.
Git::SVN::Fetcher ends up using the main RA pool which grows
monotonically in size for the lifetime of the RA object.

Thus the only way to free that memory appears to be to destroy and
recreate the RA connection for at every --log-window-size interval.

This reduces memory usage over the course of fetching 10K revisions
using a test repository created with the script at the end of this
commit message.

As reported by time(1) on my x86-64 system:

	before: 54024k
	 after: 28680k

Unfortunately, there remains some yet-to-be-tracked-down slow memory
growth which would be evident as the `nr' parameter increases in
the repository generation script:
-----------------------------8<------------------------------
set -e
tmp=$(mktemp -d svntestrepo-XXXXXXXX)
svnadmin create "$tmp"
repo=file://"$(cd $tmp && pwd)"
svn co "$repo" "$tmp/wd"
cd "$tmp/wd"
if ! test -f a
then
	> a
	svn add a
	svn commit -m 'A'
fi

nr=10000
while test $nr -gt 0
do
	echo $nr > a
	svn commit -q -m A
	nr=$((nr - 1))
done
echo "repository created in $repo"
-----------------------------8<------------------------------

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2014-10-24 22:56:06 +00:00
..
Memoize git-svn: use YAML format for mergeinfo cache when possible 2012-06-10 08:47:53 +00:00
Editor.pm git-svn: workaround for a bug in svn serf backend 2013-12-27 20:22:19 +00:00
Fetcher.pm git-svn: allow git-svn fetching to work using serf 2013-07-07 15:43:03 -07:00
GlobSpec.pm Make git-svn branch patterns match complete URL 2012-10-05 22:48:12 +00:00
Log.pm pager: remove 'S' from $LESS by default 2014-05-07 13:41:04 -07:00
Migration.pm comments: fix misuses of "nor" 2014-03-31 15:29:27 -07:00
Prompt.pm Git::SVN::*: add missing "NAME" section to perldoc 2013-05-09 01:07:58 +00:00
Ra.pm git-svn: reload RA every log-window-size 2014-10-24 22:56:06 +00:00
Utils.pm git svn: do not overescape URLs (fallback case) 2013-01-17 23:28:12 +00:00