From 5f334cc603f7018ee6e9a28d86ab9be55b75b84c Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 25 Sep 2025 08:41:04 +0200 Subject: [PATCH] Free more resources at the end of a lookup operation. In particular, lookupEnd() could keep unprocessed record data in memory until the next lookup operation, for no good reason. Signed-off-by: Miod Vallat --- modules/lmdbbackend/lmdbbackend.cc | 12 ++++++------ modules/lmdbbackend/lmdbbackend.hh | 9 +++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index 49dee0da0..44041b25d 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -1921,14 +1921,14 @@ void LMDBBackend::lookupInternal(const QType& type, const DNSName& qdomain, doma } while (type != QType::SOA && hunt.chopOff()); if (info.id == 0) { // cout << "Did not find zone for "<< qdomain<prefix(match, key, val) != 0) { - d_lookupstate.cursor.reset(); // will cause get() to fail + d_lookupstate.reset(); // will cause get() to fail if (dolog) { g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " us to execute (found nothing)" << endl; } @@ -1988,7 +1988,7 @@ bool LMDBBackend::getInternal(DNSName& basename, std::string_view& key) d_lookupstate.rrset.clear(); // will invalidate lrr if (d_lookupstate.cursor && d_lookupstate.cursor->next(d_lookupstate.key, d_lookupstate.val) != 0) { // cerr<<"resetting d_lookupstate.cursor 2"<next(d_lookupstate.key, d_lookupstate.val) != 0) { // cerr<<"resetting d_lookupstate.cursor 1"<