Edgewall Software

Ticket #6588 (new defect)

Opened 8 months ago

Last modified 2 months ago

trac-admin resync leaks memory FAST!

Reported by: marcin.owsiany@… Owned by: jonas
Priority: normal Milestone: not applicable
Component: version control Version: 0.10.4
Severity: minor Keywords: svn resync memory verify
Cc:

Description

I am upgrading a trac installation from 0.9.5 to 0.10.4.

As recommended, I'm trying to run a resync in our environment as the last stage of the upgrade. Unfortunately this fails about 4% before finishing, apparently due to running out of memory. The repository our project uses has over 40k revisions, and my estimation is that trac-admin resync leaks about 40 MB of memory per 1000 revisions. Well, maybe not all this is being leaked, but it grew from 30 MB (resident size) shortly after starting to over 150 MB at revision 3000.

I just created a huge swapfile to see if it succeds with more memory available.

We are using a sqlite backend.

Attachments

Change History

Changed 8 months ago by marcin.owsiany@…

Unfortunately adding more swap does not help. I think trac-admin could just be hitting the maximum python heap size on 32-bit systems. Adding a print_exc() to the exception handler gives me:

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 97, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/lib/python2.3/cmd.py", line 210, in onecmd
    return func(arg)
  File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 707, in do_resync
    repos = self._resync(env.get_repository())
  File "/usr/lib/python2.3/site-packages/trac/scripts/admin.py", line 682, in _resync
    repos.sync(_feedback)
  File "/usr/lib/python2.3/site-packages/trac/versioncontrol/cache.py", line 185, in sync
    (str(next_youngest),
  File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/usr/lib/python2.3/site-packages/sqlite/main.py", line 255, in execute
    self.rs = self.con.db.execute(SQL % parms)
MemoryError

Also, forgot to mention that we're running it on python 2.3 on RHEL4.

Changed 8 months ago by cboos

  • keywords memory added
  • severity changed from normal to minor
  • milestone set to 0.11.1

While this error is annoying, it shouldn't be a show stopper. Once you've started the resync, the tables are cleared and populated again with each missing changeset, normally in one go. But if that fails, the next automatic resync attempt (i.e. not the resync command, the one triggered by accessing the project through the web interface) will resume the unfinished work.

Changed 2 months ago by cboos

  • keywords verify added; sqlite removed
  • component changed from general to version control
  • milestone changed from 0.11.2 to not applicable

Could be related to the following bug in the Python bindings for Subversion:

  • issue 3052
  • fixed in r28544 (in svn 1.5 only for now)

(while the summary of the issue indicates svn_ra, the fix and the changeset comment indicate it's a more general issue)

Add/Change #6588 (trac-admin resync leaks memory FAST!)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
The owner will change to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.