--- /dev/null
+Return-Path: <kushal.kumaran@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id B53DA431FBC\r
+ for <notmuch@notmuchmail.org>; Tue, 4 Feb 2014 01:01:22 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 4TtVlK3eIWbN for <notmuch@notmuchmail.org>;\r
+ Tue, 4 Feb 2014 01:01:15 -0800 (PST)\r
+Received: from mail-yk0-f172.google.com (mail-yk0-f172.google.com\r
+ [209.85.160.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 0C8C6431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 4 Feb 2014 01:01:14 -0800 (PST)\r
+Received: by mail-yk0-f172.google.com with SMTP id 200so20714687ykr.3\r
+ for <notmuch@notmuchmail.org>; Tue, 04 Feb 2014 01:01:13 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+ :mime-version:content-type;\r
+ bh=AJUu7+gxvVgzYpgIaFMXEFkHVTA8W++gTYZCywtnGRA=;\r
+ b=E2Unmpa7yZqWNrp9QN8HKPamgZydFt3zph+/lrCAadzTx1CJ1NqkfJskwiJbNIiOrs\r
+ OEqgAI8dCMRFAM0oKBzFHGYrBQggs1UmGPSF4vjtTch2GfdrTRpID+8F3fGbo1XutHir\r
+ 0NCXqD6JRlzPahy/mmThia8BCa9e90kWT4n4dQgfJZIC9/99BzsM87CnWKI46azndvfv\r
+ 08VrWXG+UQmRyMdBbpvPLDY9ZczUIhXCWybRbYRD7js5bL/+QNbq5w1GSgQTL1tA3PRR\r
+ NsCpQmZXoqkI6Hn95Y4fxgUk2wqd4VCBLxRXZHS5CjWpa4dC2OOx2tWqowpZaM6AkBPH\r
+ lbMA==\r
+X-Received: by 10.236.151.198 with SMTP id b46mr38141076yhk.3.1391504473164;\r
+ Tue, 04 Feb 2014 01:01:13 -0800 (PST)\r
+Received: from magnesium ([198.199.83.138]) by mx.google.com with ESMTPSA id\r
+ v41sm20730223yhi.19.2014.02.04.01.01.11 for <notmuch@notmuchmail.org>\r
+ (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);\r
+ Tue, 04 Feb 2014 01:01:12 -0800 (PST)\r
+Received: by magnesium (Postfix, from userid 1000)\r
+ id 330404503E; Tue, 4 Feb 2014 14:31:11 +0530 (IST)\r
+From: Kushal Kumaran <kushal.kumaran@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: notmuch killed due to out of memory - how to move forward\r
+In-Reply-To: <87r47jcmj6.fsf@nikula.org>\r
+References:\r
+ <CAOxvSbfWu3M=M1PyFrZcUhszjW0rpb0wYOiia+3sSSd9AGqD4w@mail.gmail.com>\r
+ <87r47jcmj6.fsf@nikula.org>\r
+User-Agent: Notmuch/0.17+35~g3b36898 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 04 Feb 2014 14:31:10 +0530\r
+Message-ID: <52f0ac58.4188ec0a.7ff8.ffff9762@mx.google.com>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+ micalg=pgp-sha1; protocol="application/pgp-signature"\r
+X-Mailman-Approved-At: Tue, 04 Feb 2014 09:26:02 -0800\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 04 Feb 2014 09:01:22 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Jani Nikula <jani@nikula.org> writes:\r
+\r
+> On Mon, 03 Feb 2014, Hamish Downer <hamish@foobacca.co.uk> wrote:\r
+>> Hello\r
+>>\r
+>> I recently deleted almost 30000 old messages from my maildirs, and\r
+>> since I did that, notmuch new has not managed to complete. I have it\r
+>> running on a server with 1 GB of RAM, and the output is telling me\r
+>>\r
+>> Cleaned up 25515 of 29803 messages (1m 10s remaining).\r
+>>\r
+>> at the point it is killed. I have followed it up to this point with\r
+>> top and free and I can see memory usage growing to something like\r
+>> 700MB (RES) at which point the process is killed.\r
+>>\r
+>> I am using notmuch 0.17 (from the debian jessie package 0.17-3) on\r
+>> debian wheezy 64 bit.\r
+>>\r
+>> Any pointers as to what to do to get past this point would be greatly\r
+>> appreciated. If I have just deleted that many messages should I just\r
+>> expect notmuch to use that much memory? (Unfortunately the company\r
+>> supplying the server does not allow swap to be enabled so I can't fudge\r
+>> it that way)\r
+>>\r
+>> I did also try running it with NOTMUCH_TALLOC_REPORT, but that didn't\r
+>> produce a report (though I was unsure if I needed to rebuild notmuch\r
+>> before that would work).\r
+>>\r
+>> Happy to build notmuch from source if this might be an interesting bug\r
+>> worth tracking down.\r
+>\r
+> Please try SIGINT, or ^C, on notmuch new before it gets killed. That\r
+> should be handled gracefully, making progress, and letting you chop up\r
+> and eventually finish the operation. Please let us know if this helps.\r
+>\r
+> Needless to say, we shouldn't use that much memory just to delete files\r
+> from the index.\r
+>\r
+\r
+When I initially indexed my email archives into notmuch, I had problems\r
+with thermal cutouts, so I did something like this, which automated the\r
+workaround you mention:\r
+\r
+while :; do\r
+ timeout -s INT 2m notmuch new\r
+ sleep 600\r
+done\r
+\r
+Of course, with memory issues as the constraint rather than temperature,\r
+the sleep should not be necessary.\r
+\r
+=2D-=20\r
+regards,\r
+kushal\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.14 (GNU/Linux)\r
+\r
+iQEcBAEBAgAGBQJS8KxWAAoJEKolkdITDqLt8bEIALOGQuoW+tiREnDcM4EFJ7FS\r
+OWnEOi6aqxHTQoIY6ADQ3dm1a6p2albi8QY4jMlNVC0ODJiRFd8hExcIkUXlU2hU\r
+cNA8KOKcM4ILEVrzjoies7yJLiibCx/mxRtSyGe8HC78z0j58C/HT9W4cl3fxcQA\r
+k1ImqsVeY56VkOAClPUeUT8jwseZIMIbZTlq735HfkLk+gHwBkrCHeIMdjFf7eWg\r
+PfLQXaEnkq5jNFvG8jVf4JI+BADYr+IOi507yiynMhdtxf5zHTumn2m+qLxw6+tW\r
++Nnv2NXwSwdTW0Z7HHQYRcTfHZql5x//4tNWzgJyMp/w3a2tljfdcf4JEo6p6CE=\r
+=oqgO\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r