mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 23:53:41 +02:00
channeldb + wtdb: specify freelist bbolt options by default
This commit specifies two bbolt options when opening the underlying channel and watchtower databases so that there is reduced heap pressure in case the bbolt database has a lot of free pages in the B+ tree.
This commit is contained in:
@@ -63,7 +63,14 @@ func createDBIfNotExist(dbPath, name string) (*bbolt.DB, bool, error) {
|
||||
}
|
||||
}
|
||||
|
||||
bdb, err := bbolt.Open(path, dbFilePermission, nil)
|
||||
// Specify bbolt freelist options to reduce heap pressure in case the
|
||||
// freelist grows to be very large.
|
||||
options := &bbolt.Options{
|
||||
NoFreelistSync: true,
|
||||
FreelistType: bbolt.FreelistMapType,
|
||||
}
|
||||
|
||||
bdb, err := bbolt.Open(path, dbFilePermission, options)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user