Skip to content

Commit

Permalink
fix memory grow when perf evidence (FISCO-BCOS#4223)
Browse files Browse the repository at this point in the history
  • Loading branch information
bxq2011hust committed May 10, 2024
1 parent 07a54f2 commit 2ba9577
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion bcos-executor/src/executor/TransactionExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2504,7 +2504,8 @@ void TransactionExecutor::removeCommittedState()
if (it != m_stateStorages.end())
{
EXECUTOR_NAME_LOG(INFO)
<< "Set state number, " << it->number << " prev to cachedStorage";
<< "Set state number, " << it->number << " prev to cachedStorage"
<< LOG_KV("stateStorageSize", m_stateStorages.size());
it->storage->setPrev(m_cachedStorage);
}
}
Expand Down
12 changes: 6 additions & 6 deletions bcos-table/src/StateStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,16 @@ class BaseStorage : public virtual storage::StateStorageInterface,
updatedCapacity -= entryOld->size();

bucket->container.modify(it, [&entry](Data& data) { data.entry = std::move(entry); });

if constexpr (enableLRU)
{
updateMRUAndCheck(*bucket, it);
}
}
else
{
bucket->container.emplace(
auto [iter, _] = bucket->container.emplace(
Data{std::string(tableView), std::string(keyView), std::move(entry)});
it = iter;
}
if constexpr (enableLRU)
{
updateMRUAndCheck(*bucket, it);
}

if (m_recoder.local())
Expand Down

0 comments on commit 2ba9577

Please sign in to comment.