This commit is contained in:
alex.sharov 2022-08-24 16:07:32 +07:00
parent 23c7f503e0
commit 5110fa3a13

View File

@ -121,6 +121,7 @@ func (opts MdbxOpts) Set(opt MdbxOpts) MdbxOpts {
func (opts MdbxOpts) InMem() MdbxOpts { func (opts MdbxOpts) InMem() MdbxOpts {
opts.inMem = true opts.inMem = true
opts.flags = mdbx.UtterlyNoSync | mdbx.NoMetaSync | mdbx.LifoReclaim | mdbx.WriteMap opts.flags = mdbx.UtterlyNoSync | mdbx.NoMetaSync | mdbx.LifoReclaim | mdbx.WriteMap
opts.mapSize = 64 * datasize.MB
return opts return opts
} }
@ -188,9 +189,7 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) {
} }
if opts.mapSize == 0 { if opts.mapSize == 0 {
if opts.inMem { if !opts.inMem {
opts.mapSize = 64 * datasize.MB
} else {
opts.mapSize = 3 * datasize.TB opts.mapSize = 3 * datasize.TB
} }
} }