Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/libData/AccountData/Account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
3 changes: 0 additions & 3 deletions src/libDirectoryService/FinalBlockPostProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,6 @@ void DirectoryService::ProcessFinalBlockConsensusWhenDone() {
}
}

// Clear STL memory cache
DetachedFunction(1, CommonUtils::ReleaseSTLMemoryCache);

m_mediator.UpdateDSBlockRand();
m_mediator.UpdateTxBlockRand();

Expand Down
3 changes: 0 additions & 3 deletions src/libLookup/Lookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions src/libNode/FinalBlockProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions src/libPersistence/Retriever.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
}
Expand Down
14 changes: 0 additions & 14 deletions src/libUtils/CommonUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 0 additions & 2 deletions src/libUtils/CommonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include "common/BaseType.h"

namespace CommonUtils {
void ReleaseSTLMemoryCache();

bool IsVacuousEpoch(const uint64_t& epochNum);
} // namespace CommonUtils

Expand Down