plugeth/core/rawdb
AusIV 3ebfeb09fe
core/rawdb: fix high memory usage in freezer (#21243)
The ancients variable in the freezer is a list of hashes, which
identifies all of the hashes to be frozen. The slice is being allocated
with a capacity of `limit`, which is the number of the last block
this batch will attempt to add to the freezer. That means we are
allocating memory for all of the blocks in the freezer, not just
the ones to be added.

If instead we allocate `limit - f.frozen`, we will only allocate
enough space for the blocks we're about to add to the freezer. On
mainnet this reduces usage by about 320 MB.
2020-06-19 10:51:37 +03:00
..
accessors_chain_test.go core/rawdb: check hash before return data from ancient db (#20195) 2019-11-19 12:32:57 +02:00
accessors_chain.go cmd, core, eth: background transaction indexing (#20302) 2020-05-11 18:58:43 +03:00
accessors_indexes_test.go core: lookup txs by block number instead of block hash (#19431) 2019-04-25 17:24:55 +03:00
accessors_indexes.go cmd, core, eth: background transaction indexing (#20302) 2020-05-11 18:58:43 +03:00
accessors_metadata.go cmd/geth, core/rawdb: seamless freezer consistency, friendly removedb 2019-05-16 17:01:56 +03:00
accessors_snapshot.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00
chain_iterator_test.go cmd, core, eth: background transaction indexing (#20302) 2020-05-11 18:58:43 +03:00
chain_iterator.go all: fix typos in comments (#21118) 2020-05-25 10:21:28 +02:00
database.go core/rawdb: stop freezer process as part of freezer.Close() (#21010) 2020-05-11 15:11:17 +03:00
freezer_table_test.go core/rawdb: swap tailId and itemOffset for deleted items in freezer (#21220) 2020-06-17 09:41:07 +02:00
freezer_table.go core/rawdb: swap tailId and itemOffset for deleted items in freezer (#21220) 2020-06-17 09:41:07 +02:00
freezer.go core/rawdb: fix high memory usage in freezer (#21243) 2020-06-19 10:51:37 +03:00
schema.go cmd, core, eth: background transaction indexing (#20302) 2020-05-11 18:58:43 +03:00
table_test.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00
table.go all: simplify and fix database iteration with prefix/start (#20808) 2020-04-15 14:08:53 +03:00