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 AbsPathForConfigVal(fs::path(gArgs.GetArg("-pid", BITCOIN_PID_FILENAME)));
}
void CreatePidFile(const fs::path &path, pid_t pid)
{
    FILE* file = fsbridge::fopen(path, "w");
    if (file)
    {
        fprintf(file, "%d\n", pid);
        fclose(file);
    }
}
#endif
bool RenameOver(fs::path src, fs::path dest)
{
#ifdef WIN32
    return MoveFileExW(src.wstring().c_str(), dest.wstring().c_str(),
                       MOVEFILE_REPLACE_EXISTING) != 0;
#else
    int rc = std::rename(src.string().c_str(), dest.string().c_str());
    return (rc == 0);
#endif 
}
/**
 * Ignores exceptions thrown by Boost's create_directories if the requested directory exists.
 * Specifically handles case where path p exists, but it wasn't possible for the user to
 * write to the parent directory.
 */
bool TryCreateDirectories(const fs::path& p)