Potential issue with memory usage
adrian at cadifra.com
Thu May 19 02:26:47 CDT 2011
Regarding the recent rehashing of object cycles and GC, we just got a
new bugreport on TortoiseHg about memory usage staying high (IIUC, we had
that in the past)
The bugreport is here:
Title is: "Abnormal memory usage with thg > 2.0"
That user there writes: "Starting with 2.0 thg has become a resource hog.
See screenshot. With thg 1.1.x it was consuming at most 100mb in total"
First gut reaction could be: "Oh, yea. PyQt GUI...".
But looking at the screenshot said user uploaded, we can see:
thg.exe 390 656 K <- PyQt GUI stuff
TortoiseHgOverlayServer.exe 453 336 K
What's interesting is, TortoiseHgOverlayServer is not using PyQt at all,
just Mercurial and some weird Windows API functions. The overlay server
doesn't even load extensions.
The code for the overlay server can be found here:
The oserver sits there, listening on a Windows named pipe which is connected
to the overlay handler Windows shell extension (which is responsible for
showing the status icons on files in Explorer) at the other end, executing
refresh commands for mercurial repos, issued by the shell extension.
The inner part of the oserver is in shlib.update_thgstatus
which basically does
repo = hg.repository(ui, root) # a fresh repo object is needed
repostate = repo.status() # will update .hg/dirstate as a side effect
modified, added, removed, deleted = repostate[:4]
and writes a TortoiseHg specific file ".hg/thgstatus" with status information
about the directories.
The shell extension overlay handler itself just reads .hg/thgstatus and .hg/dirstate
I don't see the oserver eating memory that much here (Windows 7 x64). I see
peak memory ~50 MB and then it drops back to ~20 MB when it's idle.
So how is it possible that the TortoiseHgOverlayServer is consuming that much
I'm writing "Potential issue with memory usage" because I don't know if its
related to mercurial itself, but the TortoiseHgOverlayServer is basically
unchanged from TortoiseHg 1.x and that user reports he didn't have that
problem on TortoiseHg 1.x.
So, a candidate from my list of wild guessings could be: Mercurial 1.8.
Any hints are most welcome. Thanks for reading this far.
More information about the Mercurial-devel