mmm: reduce default mmap size.
This commit is contained in:
@@ -61,7 +61,7 @@ func (il *IndexingLayer) Init() error {
|
|||||||
|
|
||||||
env.SetMaxDBs(9)
|
env.SetMaxDBs(9)
|
||||||
env.SetMaxReaders(1000)
|
env.SetMaxReaders(1000)
|
||||||
env.SetMapSize(1 << 38) // ~273GB
|
env.SetMapSize(MMAP_INFINITE_SIZE)
|
||||||
|
|
||||||
// create directory if it doesn't exist and open it
|
// create directory if it doesn't exist and open it
|
||||||
if err := os.MkdirAll(path, 0755); err != nil {
|
if err := os.MkdirAll(path, 0755); err != nil {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"slices"
|
"slices"
|
||||||
@@ -51,7 +50,7 @@ func (b *MultiMmapManager) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MMAP_INFINITE_SIZE = math.MaxInt
|
MMAP_INFINITE_SIZE = 100_000_000_000
|
||||||
maxuint16 = 65535
|
maxuint16 = 65535
|
||||||
maxuint32 = 4294967295
|
maxuint32 = 4294967295
|
||||||
)
|
)
|
||||||
@@ -106,7 +105,7 @@ func (b *MultiMmapManager) Init() error {
|
|||||||
|
|
||||||
env.SetMaxDBs(3)
|
env.SetMaxDBs(3)
|
||||||
env.SetMaxReaders(1000)
|
env.SetMaxReaders(1000)
|
||||||
env.SetMapSize(1 << 38) // ~273GB
|
env.SetMapSize(MMAP_INFINITE_SIZE)
|
||||||
|
|
||||||
err = env.Open(dbpath, lmdb.NoTLS, 0644)
|
err = env.Open(dbpath, lmdb.NoTLS, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user