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.
ret = notmuch_message_reindex(message, indexopts);
if (ret != NOTMUCH_STATUS_SUCCESS)
break;
+ notmuch_message_destroy (message);
}
if (!ret)