Closed Roasbeef closed 4 months ago
cc @kcalvinalvin
Will take a look today but my initial assumption is that the 3GB part is how much the preallocated map is taking up.
The actual allocation happens like so:
1: User passes in the acceptable mem usage. 2: Pre-allocate a map based on this. It's usually like half of the mem usage (ex: 8gb of utxocache will alloc ~4gb initially) 3: utxo cache memory usage increases as each utxoentry is cached. The variable sized pkscript places a big part of this memory usage.
Did that happen at the very start? If we're not in headers first, it'll try to "flush" the utxocache. If it was "flushing 1 entry" at the very first start that may be an off by one on the log message It was not an off by one on the log message. On the flush it just had the coinbase tx for block 1 already in the cache.
Fixed with #2089
Was running some sync tests with various configurations and spotted this upon restart:
1 entry, yet 3 GB cache size, smells like an accounting error....