Christian Boos wrote:
> ...
> From my very latest findings, it appears that there are two issues,
> probably rooted in the same cause.
>
> 1. At the very least the `data` dictionary of every request gets
> accumulated over time.
>
...
> To be clear, when I say "accumulated" in the above, it's really that
> those objects are considered live by the GC, not unreachable. I do a
> gc.collect() with the SAVE_ALL flag set, after every request, and
> collect() says we have no unreachable objects. This means that
> apparently we're doing the right thing for our __del__ stuff.
>
Crap, I meant DEBUG_UNCOLLECTABLE and s/unreachable/uncollectable/ in
the above, as that's how I tested it on Linux (as reported in #6614),
but yesterday on Windows I used the above wrong flag, which means...
well, the whole case 1. was complete crap (except the remark about
get_changes() which hints about possible optimization in svn_fs.py).
This is the correct explicit_gc.diff patch which I should have used:
Index: trac/web/main.py
===================================================================
--- trac/web/main.py (revision 6489)
+++ trac/web/main.py (working copy)
@@ -390,6 +390,16 @@
finally:
if env and not run_once:
env.shutdown(threading._get_ident())
+ # Now it's a good time to do some clean-ups
+ import gc
+ gc.disable()
+ gc.set_debug(gc.DEBUG_UNCOLLECTABLE)
+ unreachable = gc.collect()
+ env.log.info("%d unreachable objects found.", unreachable)
+ uncollectable = len(gc.garbage)
+ if uncollectable:
+ del gc.garbage[:]
+ env.log.warn("%d uncollectable objects found.",
uncollectable)
def _dispatch_request(req, env, env_error):
resp = []
With that patch, there's no leak and constant memory usage for the
scenario 1.
Sorry for the confusion.
Case 2. still stands.
-- Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---