mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/fs: do not use mmap for 32-bit arches by default, since they cannot map files bigger than 4GB in RAM
This commit is contained in:
parent
81b8811cf4
commit
c9ab6dc532
1 changed files with 4 additions and 1 deletions
|
@ -10,7 +10,10 @@ import (
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
var disableMmap = flag.Bool("fs.disableMmap", false, "Whether to use pread() instead of mmap() for reading data files")
|
var disableMmap = flag.Bool("fs.disableMmap", is32BitPtr, "Whether to use pread() instead of mmap() for reading data files. "+
|
||||||
|
"By default mmap() is used for 64-bit arches and pread() is used for 32-bit arches, since they cannot data files bigger than 2^32 bytes in memory")
|
||||||
|
|
||||||
|
const is32BitPtr = (^uintptr(0) >> 32) == 0
|
||||||
|
|
||||||
// MustReadAtCloser is rand-access read interface.
|
// MustReadAtCloser is rand-access read interface.
|
||||||
type MustReadAtCloser interface {
|
type MustReadAtCloser interface {
|
||||||
|
|
Loading…
Reference in a new issue