Sun, 17 Jan 2016 14:14:15 -0800 localrepo: don't reference transaction from hook closure (issue5043)
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jan 2016 14:14:15 -0800] rev 27907
localrepo: don't reference transaction from hook closure (issue5043) Before, the hook() closure (which is called as part of locking hooks) would maintain a reference to a transaction instance (which should be finalized by the time lock hooks are called). Because we accumulate hook() instances when there are multiple transactions per lock, this would result in holding references to the transaction instances which would lead to higher memory utilization. Creating a reference to the hook arguments dict minimizes the number of objects that are kept alive until the lock release hook runs, minimizing memory "leaks."
Sun, 17 Jan 2016 12:10:30 -0800 context: don't use util.cachefunc due to cycle creation (issue5043)
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 17 Jan 2016 12:10:30 -0800] rev 27906
context: don't use util.cachefunc due to cycle creation (issue5043) util.cachefunc stores all arguments as the cache key. For filectxfn functions, the arguments include the memctx instance. This creates a cycle where memctx._filectxfn references self. This causes a memory leak. We break the cycle by implementing our own memoizing function that only uses the path as the cache key. Since each memctx has its own cache instance, there is no concern about invalid cache hits.
(0) -10000 -3000 -1000 -300 -100 -30 -10 -2 +2 +10 +30 +100 +300 +1000 +3000 +10000 tip