[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] small fix for memory leak in svn_wc_props_modified_p

From: Joel Rosdahl <joel_at_rosdahl.net>
Date: 2002-09-01 22:58:30 CEST

Good evening.

I have done some experiments to see how good Subversion currently is
at handling lots of source code. More specifically, I tested to
import/checkout/status/update/commit the Linux 2.2.21 code using a
crude benchmark script. Current time results at my system:

  Import: 358.3 s
Checkout: 348.4 s
  Status: failed
  Update: 21.9 s
  Commit: 60.4 s

(This is for ra_local.)

I won't comment the numbers, but rather the memory usage; it goes up
to at most 50 MB for import/checkout/update/commit, but running "svn
status" makes svn eat insane amounts of memory, and it consequently
gets killed for its greediness. :-) I think the attached patch fixes
the problem.

* subversion/libsvn_wc/props.c (svn_wc_props_modified_p): Avoid memory
  leak by passing subpool to svn_wc_entry.

--- subversion/libsvn_wc/props.c
+++ subversion/libsvn_wc/props.c 2002-09-01 20:34:53.000000000 +0200
@@ -1309,7 +1309,7 @@
   /* If something is scheduled for replacement, we do *not* want to
      pay attention to any base-props; they might be residual from the
      old deleted file. */
- SVN_ERR (svn_wc_entry (&entry, path, TRUE, pool));
+ SVN_ERR (svn_wc_entry (&entry, path, TRUE, subpool));
   if (entry
       && ((entry->schedule == svn_wc_schedule_replace)
           || (entry->schedule == svn_wc_schedule_add)))

        Regards,
        Joel

-- 
Joel Rosdahl <joel@rosdahl.net>  (GnuPG/PGP key available)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Sep 2 00:03:50 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.