我正在使用 leveldb 进行压力测试。
在util/env_poisx.cc : NewRandomAccessFile()
void* base = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
在插入 300 万个数据(每个 100k)之后。errno 说Cannot allocate memory
。
为什么?
更多细节:
最佳:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
19794 root 20 0 290g 4.9g 4.7g S 98.6 7.8 2348:00 ldb
免费-m:
total used free shared buffers cached
Mem: 64350 60623 3726 0 179 59353
-/+ buffers/cache: 1090 63259
Swap: 996 0 996
ulimit -a:
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 10240
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 530432
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
系统控制:
vm.max_map_count = 300000
kernel.shmmni = 8092
kernel.shmall = 4194304
kernel.shmmax = 2147483648