From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH 1/2] CLI/reindex: fix memory leak
Date: Wed, 17 Apr 2019 20:04:36 +0300 [thread overview]
Message-ID: <m2d0lkzhp7.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <20190416014616.31623-2-david@tethera.net>
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
next prev parent reply other threads:[~2019-04-17 17:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 1:46 reindex improvements David Bremner
2019-04-16 1:46 ` [PATCH 1/2] CLI/reindex: fix memory leak David Bremner
2019-04-17 17:04 ` Tomi Ollila [this message]
2019-04-19 2:22 ` David Bremner
2019-04-16 1:46 ` [PATCH 2/2] n_m_remove_indexed_terms: reduce number of Xapian API calls David Bremner
2019-05-22 11:58 ` David Bremner
2019-05-23 11:40 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2d0lkzhp7.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).