Limit the amount of deduplication items we store (#1371)
This commit is contained in:
parent
f7a505ba36
commit
02d65c2266
1 changed files with 11 additions and 0 deletions
|
@ -2010,6 +2010,17 @@ std::pair<std::unique_ptr<rai::pending_key>, std::unique_ptr<rai::pending_info>>
|
|||
{
|
||||
if (deduplication.count (info.source) != 0)
|
||||
{
|
||||
/*
|
||||
* If the deduplication map gets too
|
||||
* large, clear it out. This may
|
||||
* result in some duplicates getting
|
||||
* sent to the client, but we do not
|
||||
* want to commit too much memory
|
||||
*/
|
||||
if (deduplication.size () > 4096)
|
||||
{
|
||||
deduplication.clear ();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue