MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / DynamicMemoryUsage

Method DynamicMemoryUsage

src/txmempool.cpp:778–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778size_t CTxMemPool::DynamicMemoryUsage() const {
779 LOCK(cs);
780 // Estimate the overhead of mapTx to be 9 pointers (3 pointers per index) + an allocation, as no exact formula for boost::multi_index_contained is implemented.
781 return memusage::MallocUsage(sizeof(CTxMemPoolEntry) + 9 * sizeof(void*)) * mapTx.size() + memusage::DynamicUsage(mapNextTx) + memusage::DynamicUsage(mapDeltas) + memusage::DynamicUsage(txns_randomized) + m_txgraph->GetMainMemoryUsage() + cachedInnerUsage;
782}
783
784void CTxMemPool::RemoveUnbroadcastTx(const Txid& txid, const bool unchecked) {
785 LOCK(cs);

Callers 3

addNewTransactionMethod · 0.45
removeUncheckedMethod · 0.45
checkMethod · 0.45

Calls 4

MallocUsageFunction · 0.85
DynamicUsageFunction · 0.85
GetMainMemoryUsageMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected