Login | Register
My pages Projects Community openCollabNet
Click here to access Issue tracker direct from Eclipse or Visual Studio
and to obtain other CollabNet integrations.

subversion
Issue 3052

Query | Reports

Issue 3052

Issue #: 3052   Platform: All   Reporter: jrvernooij (Jelmer Vernooij)
Component: subversion   OS: All  
Subcomponent: bindings_swig_python   Version: ---   CC:
Remove selected CCs
Status: VERIFIED   Priority: P3  
Resolution: FIXED   Issue type: DEFECT  
 Target milestone:1.5.0 
Assigned to: issues@subversion
URL:
* Summary: Memory leak in svn.ra.get_log()
Status whiteboard:
Keywords:
Attachments:
Date/filename: Description: Submitted by:
Fri Dec 14 03:46:00 -0800 2007: memleak.py Python script that demonstrates the problem (text/plain) Jelmer Vernooij
Fri Dec 14 04:14:00 -0800 2007: fix-3052-hack.diff Patch that fixes the issue but also breaks the API slightly (text/plain) Jelmer Vernooij
Fri Dec 14 05:40:00 -0800 2007: memleak.py Update of the testcase with a (partial) workaround (text/plain) Jelmer Vernooij
Issue 3052 depends on: Show dependency tree
Issue 3052 blocks:

View issue activity   |   Format for printing   |   Format as XML

Description: Opened: Fri Dec 14 03:46:00 -0800 2007 Sort by: Oldest first | Newest first

The python bindings for svn.ra.get_log() leak heavily, as demonstrated by the
attached patch. When running locally, they use up to 300Mb for just the first
30k revisions.

------- Additional comments from Jelmer Vernooij Fri Dec 14 03:46:41 -0800 2007 -------

Created an attachment (id=831)
Python script that demonstrates the problem

------- Additional comments from Jelmer Vernooij Fri Dec 14 03:47:54 -0800 2007 -------

This has also been reproduced by the Mercurial folks, who work around it at the
moment by parsing the output of "svn log"... 

http://hg.intevation.org/mercurial/crew/file/e8f4e40f285a/hgext/convert/subversion.py

------- Additional comments from Jelmer Vernooij Fri Dec 14 03:48:23 -0800 2007 -------

I'd like to have a look at fixing this, but I'm not sure where to start. Any
hints would be much appreciated.

------- Additional comments from Jelmer Vernooij Fri Dec 14 04:13:29 -0800 2007 -------

The attached patch fixes the memory leak, but also breaks API compatibility
slightly. 

------- Additional comments from Jelmer Vernooij Fri Dec 14 04:14:27 -0800 2007 -------

Created an attachment (id=832)
Patch that fixes the issue but also breaks the API slightly

------- Additional comments from Jelmer Vernooij Fri Dec 14 05:40:02 -0800 2007 -------

Created an attachment (id=833)
Update of the testcase with a (partial) workaround

------- Additional comments from C. Michael Pilato Mon Dec 17 06:38:18 -0800 2007 -------

What's the slight API breakage?  What would no longer work in existing consumers
of this Python API?

------- Additional comments from Jelmer Vernooij Tue Dec 18 06:18:23 -0800 2007 -------

It would change the contents of the values changed_path from a class to a tuple.
This means the items of a changed_path element would no longer be accessible by
name and so would break all existing users of that API.

It would be nice if somebody familiar with the memory management code in the
Python bindings could have a look at this. I think it's quite easy to fix if you
know your way around.

------- Additional comments from C. Michael Pilato Tue Dec 18 06:33:59 -0800 2007 -------

Oh.  That is *so* not permissible.  We'll have to do better than that.

------- Additional comments from C. Michael Pilato Wed Dec 19 07:58:50 -0800 2007 -------

I believe this was fixed in r28544.

------- Additional comments from David James Wed Dec 19 09:55:44 -0800 2007 -------

That's right, Mike. (It's fixed in r28544).

For the record, I also nominated this fix for Subversion 1.4.7 since this is a
serious problem.