Turn off readahead on main mmap

It's harmful when the DB is larger than RAM.
vmware
Howard Chu 12 years ago
parent d74330128a
commit b1da555c4c
  1. 2
      libraries/liblmdb/mdb.c

@ -2870,6 +2870,8 @@ mdb_env_open2(MDB_env *env)
env->me_map = NULL; env->me_map = NULL;
return ErrCode(); return ErrCode();
} }
/* Turn off readahead. It's harmful when the DB is larger than RAM. */
posix_madvise(env->me_map, env->me_mapsize, POSIX_MADV_RANDOM);
#endif #endif
if (newenv) { if (newenv) {

Loading…
Cancel
Save