add info for vm.max_map_count incorrectly set. (#17727)

This commit is contained in:
Jeff Washington (jwash) 2021-06-03 22:22:12 -05:00 committed by GitHub
parent 3a647c4bea
commit 81bafd9daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -305,7 +305,14 @@ impl AppendVec {
let file_size = std::fs::metadata(&path)?.len();
AppendVec::sanitize_len_and_size(current_len, file_size as usize)?;
let map = unsafe { MmapMut::map_mut(&data)? };
let map = unsafe {
let result = MmapMut::map_mut(&data);
if result.is_err() {
// for vm.max_map_count, error is: {code: 12, kind: Other, message: "Cannot allocate memory"}
info!("memory map error: {:?}. This may be because vm.max_map_count is not set correctly.", result);
}
result?
};
let new = AppendVec {
path: path.as_ref().to_path_buf(),