Re: 'notmuch new' leaking memory and getting slower over time?
[notmuch-archives.git] / 2a / d75bbf2eaad80bb3347e31c0ed6b2f1381afe2
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 63B54431FB6\r
6         for <notmuch@notmuchmail.org>; Tue, 22 Nov 2011 18:46:02 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id C+d3kibxYolD for <notmuch@notmuchmail.org>;\r
16         Tue, 22 Nov 2011 18:46:02 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU\r
18         [18.7.68.35])\r
19         by olra.theworths.org (Postfix) with ESMTP id D7788429E30\r
20         for <notmuch@notmuchmail.org>; Tue, 22 Nov 2011 18:46:01 -0800 (PST)\r
21 X-AuditID: 12074423-b7f266d0000008b8-ae-4ecc5e68bc1c\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id DD.2D.02232.86E5CCE4; Tue, 22 Nov 2011 21:46:00 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id pAN2jx67029817; \r
27         Tue, 22 Nov 2011 21:46:00 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pAN2jvgk002876\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Tue, 22 Nov 2011 21:45:59 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1RT2sk-0006s3-MG; Tue, 22 Nov 2011 21:48:18 -0500\r
37 Date: Tue, 22 Nov 2011 21:48:18 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Petter Reinholdtsen <pere@hungry.com>\r
40 Subject: Re: 'notmuch new' leaking memory and getting slower over time?\r
41 Message-ID: <20111123024818.GI9351@mit.edu>\r
42 References: <2flfwhht87d.fsf@diskless.uio.no>\r
43 MIME-Version: 1.0\r
44 Content-Type: text/plain; charset=us-ascii\r
45 Content-Disposition: inline\r
46 In-Reply-To: <2flfwhht87d.fsf@diskless.uio.no>\r
47 User-Agent: Mutt/1.5.21 (2010-09-15)\r
48 X-Brightmail-Tracker:\r
49  H4sIAAAAAAAAA+NgFprAKsWRmVeSWpSXmKPExsUixG6nrpsRd8bPYNNxOYvrN2cyW+y8OoHR\r
50         gcmjc+leVo9nq24xBzBFcdmkpOZklqUW6dslcGV8OtnGXrCSq+LDtO/MDYwLOLoYOTkkBEwk\r
51         OhasY4ewxSQu3FvP1sXIxSEksI9RovXPA3YIZwOjxKpJd6Cck0wSn9uXQzlLGCUavp8C62cR\r
52         UJV4+GsTmM0moCGxbf9yRhBbREBT4umPXcwgNrOAtMS3381MILawgLvE+0mrwGp4BbQlJnfc\r
53         YQOxhQR0JdYf/8MKEReUODnzCQtEr5bEjX8vgXo5wOYs/wf2AqeAnsTZiXvA1ooKqEhMObmN\r
54         bQKj0Cwk3bOQdM9C6F7AyLyKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI10wvN7NELzWldBMjOLBd\r
55         lHcw/jmodIhRgINRiYc38uRpPyHWxLLiytxDjJIcTEqivBqxZ/yE+JLyUyozEosz4otKc1KL\r
56         DzFKcDArifBecwfK8aYkVlalFuXDpKQ5WJTEeWV2OvgJCaQnlqRmp6YWpBbBZGU4OJQkeBtB\r
57         hgoWpaanVqRl5pQgpJk4OEGG8wANXwBSw1tckJhbnJkOkT/FqMux4Mr104xCLHn5ealS4rzd\r
58         IEUCIEUZpXlwc2AJ6RWjONBbwrwlIFU8wGQGN+kV0BImoCXT1p4AWVKSiJCSamDk1lkWejv+\r
59         pegJ3Qqp/Iw7rhuOWvmpRYrf5L34XPSwXl1N/S3jwyqSS/LirY6xZVcv/mV2vUjFa8vjTEft\r
60         41u839Y/K3Tf8ufqhMuHMj3e3TJZwFq25pZW+b/6Zxp//yqFc7IsYtuhH8pdv+HopCmW58Vm\r
61         vzbw9vwo1rKzJFD87HG3IMuMx0eVWIozEg21mIuKEwE2yfBDIwMAAA==\r
62 Cc: notmuch@notmuchmail.org\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Wed, 23 Nov 2011 02:46:02 -0000\r
76 \r
77 Quoth Petter Reinholdtsen on Nov 21 at 11:35 pm:\r
78 > The indexing took 36 hours.  At the start it claimed it would take 10\r
79 > hours, and it continued to underestimate the amount of time left until\r
80 > the very end.  It claimed to have 1 hour left when I checked before I\r
81 > went to bed, and claimed to have 15 minutes left when I woke up 6-7\r
82 > hours later.\r
83 \r
84 notmuch new does a simple linear extrapolation based on how many files\r
85 it's examined and how many there are total.  This is doomed to\r
86 undershoot at least because indexing becomes slower as the database\r
87 grows (B-tree insertion is O(log N), fragmentation will increase over\r
88 time, posting lists will get longer...).\r
89 \r
90 I'm not sure much can be done about the estimate at the beginning,\r
91 short of throwing in some fudge factor, but the estimates later in the\r
92 process would be much more accurate if it used a sliding window,\r
93 rather than measuring from the beginning.\r
94 \r
95 > Shortly before the indexing finished, the notmuch process was using 1.2\r
96 > GiB of resident memory according to top.  Is the process leaking memory?\r
97 \r
98 It's possible this is just memory fragmentation, but it definitely\r
99 sounds like a leak.  talloc has some tools for tracking down leaks and\r
100 it would be good to heap profile notmuch new, but to my knowledge\r
101 nobody's applied these tools.\r