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,
void UnlockDirectory(const fs::path& directory, const std::string& lockfile_name);
bool DirIsWritable(const fs::path& directory);
/** Release all directory locks. This is used for unit testing only, at runtime
 * the global destructor will take care of the locks.
 */
void ReleaseDirectoryLocks();
bool TryCreateDirectories(const fs::path& p);
fs::path GetDefaultDataDir();
const fs::path &GetBlocksDir();
const fs::path &GetDataDir(bool fNetSpecific = true);
void ClearDatadirCache();
fs::path GetConfigFile(const std::string& confPath);
#ifndef WIN32
fs::path GetPidFile();
void CreatePidFile(const fs::path &path, pid_t pid);
#endif
#ifdef WIN32
fs::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
#endif
void runCommand(const std::string& strCommand);
/**
 * Most paths passed as configuration arguments are treated as relative to
 * the datadir if they are not absolute.
 *
 * @param path The path to be conditionally prefixed with datadir.
 * @param net_specific Forwarded to GetDataDir().
 * @return The normalized path.
 */
fs::path AbsPathForConfigVal(const fs::path& path, bool net_specific = true);
inline bool IsSwitchChar(char c)