From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E39A16DE10BA for ; Wed, 17 Apr 2019 10:04:42 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.452 X-Spam-Level: X-Spam-Status: No, score=0.452 tagged_above=-999 required=5 tests=[AWL=-0.210, SPF_NEUTRAL=0.652, T_SPF_HELO_TEMPERROR=0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qlS0aYnpr3Ds for ; Wed, 17 Apr 2019 10:04:41 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 541536DE0F34 for ; Wed, 17 Apr 2019 10:04:41 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 7358110006A; Wed, 17 Apr 2019 20:04:36 +0300 (EEST) From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 1/2] CLI/reindex: fix memory leak In-Reply-To: <20190416014616.31623-2-david@tethera.net> References: <20190416014616.31623-1-david@tethera.net> <20190416014616.31623-2-david@tethera.net> User-Agent: Notmuch/0.28.3+73~g5e2df9a (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2019 17:04:43 -0000 On Mon, Apr 15 2019, David Bremner wrote: > Since message is owned by messages, it was held for the entire run of > the program. This in turn means that the Xapian::Document objects are > not freed, and thus one ends up with (effectively) a copy of one's > entire mailstore in memory when running > > notmuch reindex '*' > > Thanks to Olly Betts for the patient help debugging, and the > suggestion of a fix. > --- > notmuch-reindex.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/notmuch-reindex.c b/notmuch-reindex.c > index d8589120..fefa7c63 100644 > --- a/notmuch-reindex.c > +++ b/notmuch-reindex.c > @@ -71,6 +71,7 @@ reindex_query (notmuch_database_t *notmuch, const char *query_string, > ret = notmuch_message_reindex(message, indexopts); > if (ret != NOTMUCH_STATUS_SUCCESS) > break; > + notmuch_message_destroy (message); This particular change looks trivial to me... Tomi > } > > if (!ret) > -- > 2.20.1