unit-e consumes too much memory on sync #1073
Labels
bug
A problem of existing functionality
resource usage
Issues related to usage of resources such as memory or CPU
When syncing node from the testnet the client quickly eats up all of the RAM and is killed by the OOM killer.
To reproduce it is enough to try to sync the node. It is especially easy to reproduce when having good connection with the node used for syncing.
I've identified that the issue is finalization state which is stored for every header+commits message received during header+commits sync. The state repository is not pruned fast enough as the validation lags far behind the sync and the effect is that the node consumes enormous amounts of memory (30GBs during first 40k blocks).
@frolosofsky further identified two issues:
Limiting the allowed offset between tip and synced headers should be enough to ensure proper resources usage during sync.
The state repository data could use some optimization too, as most of the states don't differ in any way (only differences arise when checkpoints are reached or there are commits on the chain - usually once or twice per epoch). In the attached Massif's output one can see that individual finalization state takes up to 4MBs of memory (at around 40k height).
The text was updated successfully, but these errors were encountered: