Hi,
Using Bitcoin Core RPC client version v0.17.0.1-g1476554d3b1db5352c0de1de7524864d4bce3aac

I'm using bitcoin-cli loadwallet and unloadwallet commands. They both seem to work fine.
Unfortunately, memory is getting higher and higher, and no wallet can be loaded after 300 have been.
The problem may be related to BerkeleyDB rather than to Bitcoin Core itself. Fact is that lsof shows handles not cleared off after the unloadwallet command is issued. Files still handled are .walletlock, db.log and database/log.0000000001 .
When 300 different wallets have been loaded/unloaded, used RAM is over 8 GB, and bitcoind will finally become unstable and fail.

Any help would be appreciated.
Regards,
{
    return nStartupTime;
}
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific)
{
    return fs::absolute(path, GetDataDir(net_specific));
}
int ScheduleBatchPriority()
{
#ifdef SCHED_BATCH
    const static sched_param param{};
    if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, &param)) {
        LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno));
        return ret;
    }
    return 0;
#else
    return 1;
#endif
}
namespace util {
#ifdef WIN32
WinCmdLineArgs::WinCmdLineArgs()