[#CTxMemPool-TrimToSize]
= xref:CTxMemPool.adoc[CTxMemPool]::TrimToSize
:relfileprefix: ../
:mrdocs:

Remove transactions from the mempool until its dynamic size is &lt;&equals; sizelimit&period; pvNoSpendsRemaining, if set, will be populated with the list of outpoints which are not in mempool which no longer have any spends in this mempool&period;

== Synopsis

Declared in `&lt;txmempool&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;requires&lowbar;capability(0x7f2e1b5a3058), requires&lowbar;capability(0x7f2e2721c068), requires&lowbar;capability(0x7f2e421cd778), requires&lowbar;capability(0x7f2e2880c738), requires&lowbar;capability(0x7f2e3212fac8), requires&lowbar;capability(0x7f2e347f8158), requires&lowbar;capability(0x7f2e2b05c5c8), requires&lowbar;capability(0x7f2e2bee3c68)&rsqb;&rsqb;
void
TrimToSize(
    size&lowbar;t sizelimit,
    std::vector&lt;COutPoint&gt;* pvNoSpendsRemaining = nullptr);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sizelimit*
| The target maximum dynamic memory size, in bytes&period;
| *pvNoSpendsRemaining*
| If set, receives outpoints no longer spent by the mempool&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
