From 81bafd9daf3da761ba0a40f6bc796a8711725344 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Thu, 3 Jun 2021 22:22:12 -0500 Subject: [PATCH] add info for vm.max_map_count incorrectly set. (#17727) --- runtime/src/append_vec.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/src/append_vec.rs b/runtime/src/append_vec.rs index fe38721fd6..2ede4b6aa2 100644 --- a/runtime/src/append_vec.rs +++ b/runtime/src/append_vec.rs @@ -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(),