diff --git a/src/libData/AccountData/Account.cpp b/src/libData/AccountData/Account.cpp index 5a3499fa56..4a6f5a8004 100644 --- a/src/libData/AccountData/Account.cpp +++ b/src/libData/AccountData/Account.cpp @@ -401,8 +401,6 @@ bool Account::FetchStateJson(Json::Value& root, const string& vname, if (ENABLE_MEMORY_STATS) { startMem = DisplayPhysicalMemoryStats("After FetchStateJson", startMem); } - // Clear STL memory cache - DetachedFunction(1, CommonUtils::ReleaseSTLMemoryCache); } if ((vname.empty() && indices.empty()) || vname == "_balance") { diff --git a/src/libDirectoryService/FinalBlockPostProcessing.cpp b/src/libDirectoryService/FinalBlockPostProcessing.cpp index 17be3241e2..ddf8cd8bf8 100644 --- a/src/libDirectoryService/FinalBlockPostProcessing.cpp +++ b/src/libDirectoryService/FinalBlockPostProcessing.cpp @@ -276,9 +276,6 @@ void DirectoryService::ProcessFinalBlockConsensusWhenDone() { } } - // Clear STL memory cache - DetachedFunction(1, CommonUtils::ReleaseSTLMemoryCache); - m_mediator.UpdateDSBlockRand(); m_mediator.UpdateTxBlockRand(); diff --git a/src/libLookup/Lookup.cpp b/src/libLookup/Lookup.cpp index cea7b8434d..84927dc168 100644 --- a/src/libLookup/Lookup.cpp +++ b/src/libLookup/Lookup.cpp @@ -3620,9 +3620,6 @@ bool Lookup::ProcessSetStateDeltasFromSeed( "AccountStore::GetInstance().DeserializeDelta failed"); return false; } - if (txBlkNum % RELEASE_CACHE_INTERVAL == 0) { - DetachedFunction(1, CommonUtils::ReleaseSTLMemoryCache); - } if (!BlockStorage::GetBlockStorage().PutStateDelta(txBlkNum, delta)) { LOG_GENERAL(WARNING, "BlockStorage::PutStateDelta failed"); return false; diff --git a/src/libNode/FinalBlockProcessing.cpp b/src/libNode/FinalBlockProcessing.cpp index f40d2ab45e..57fbe626b7 100644 --- a/src/libNode/FinalBlockProcessing.cpp +++ b/src/libNode/FinalBlockProcessing.cpp @@ -1244,9 +1244,6 @@ bool Node::ProcessFinalBlockCore(uint64_t& dsBlockNumber, << "][" << txBlock.GetHeader().GetBlockNum() << "] LAST"); } - // Clear STL memory cache - DetachedFunction(1, CommonUtils::ReleaseSTLMemoryCache); - // Assumption: New PoW done after every block committed // If I am not a DS committee member (and since I got this FinalBlock message, // then I know I'm not), I can start doing PoW again diff --git a/src/libPersistence/Retriever.cpp b/src/libPersistence/Retriever.cpp index 7de8a1e7a4..a9f3339a6e 100644 --- a/src/libPersistence/Retriever.cpp +++ b/src/libPersistence/Retriever.cpp @@ -168,10 +168,6 @@ bool Retriever::ConstructFromStateDeltas(const uint64_t& lastBlockNum, return false; } - if (j % RELEASE_CACHE_INTERVAL == 0 || j == i) { - DetachedFunction(1, CommonUtils::ReleaseSTLMemoryCache); - } - TxBlockSharedPtr txBlockPerDelta; if (!BlockStorage::GetBlockStorage().GetTxBlock( j, txBlockPerDelta)) { @@ -238,9 +234,6 @@ bool Retriever::ConstructFromStateDeltas(const uint64_t& lastBlockNum, "AccountStore::GetInstance().DeserializeDelta failed"); return false; } - if (extra_delta_index % RELEASE_CACHE_INTERVAL == 0) { - DetachedFunction(1, CommonUtils::ReleaseSTLMemoryCache); - } BlockStorage::GetBlockStorage().PutStateDelta(extra_delta_index++, stateDelta); } diff --git a/src/libUtils/CommonUtils.cpp b/src/libUtils/CommonUtils.cpp index 8531ea04a8..c10c484525 100644 --- a/src/libUtils/CommonUtils.cpp +++ b/src/libUtils/CommonUtils.cpp @@ -27,20 +27,6 @@ using namespace std; -void CommonUtils::ReleaseSTLMemoryCache() { -#ifdef __linux__ - LOG_MARKER(); - - static mutex relMemoryCacheMutex; - if (relMemoryCacheMutex.try_lock()) { - malloc_trim(0); - relMemoryCacheMutex.unlock(); - } else { - LOG_GENERAL(WARNING, "MemoryCache cleanup already in progress!"); - } -#endif -} - bool CommonUtils::IsVacuousEpoch(const uint64_t& epochNum) { return ((epochNum + NUM_VACUOUS_EPOCHS) % NUM_FINAL_BLOCK_PER_POW) == 0; } diff --git a/src/libUtils/CommonUtils.h b/src/libUtils/CommonUtils.h index 72aac307f7..f75c6d7bc8 100644 --- a/src/libUtils/CommonUtils.h +++ b/src/libUtils/CommonUtils.h @@ -21,8 +21,6 @@ #include "common/BaseType.h" namespace CommonUtils { -void ReleaseSTLMemoryCache(); - bool IsVacuousEpoch(const uint64_t& epochNum); } // namespace CommonUtils