Skip to content

Commit f8918a9

Browse files
authored
Shrink tx hash cache from 512k to 130k (#7951)
1 parent 34023ff commit f8918a9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Nethermind/Nethermind.Init/MemoryHintMan.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private void AssignPeersMemory(INetworkConfig networkConfig)
122122

123123
private void AssignTxPoolMemory(ITxPoolConfig txPoolConfig)
124124
{
125-
long hashCacheMemory = txPoolConfig.Size / 4L * 1024L * 128L;
125+
long hashCacheMemory = txPoolConfig.Size / 1024L * 128L;
126126
if ((_remainingMemory * 0.05) < hashCacheMemory)
127127
{
128128
hashCacheMemory = Math.Min((long)(_remainingMemory * 0.05), hashCacheMemory);

src/Nethermind/Nethermind.TxPool/MemoryAllowance.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Nethermind.TxPool
55
{
66
public static class MemoryAllowance
77
{
8-
public static int MemPoolSize { get; set; } = 1 << 11;
9-
public static int TxHashCacheSize { get; set; } = 1 << 19;
8+
public static int MemPoolSize { get; set; } = 2_048;
9+
public static int TxHashCacheSize { get; set; } = 131_072;
1010
}
1111
}

0 commit comments

Comments
 (0)