This is just for posterity. I've encountered this issue when updating to 9.0.1 from 8.18.1
for my allocator hosts in ECE I had to increase the vm.max_map_count=262144 Docu to 2097152 otherwise the update was failing(my container just keep restarting) with marking and sending shard failed due to [failed recovery] Call to posix_madvise failed with return code 11
java.io.IOException: Call to posix_madvise with address=0x6A6939205000 and byteSize=12939 failed with return code 11.
most probably the new code of elasticsearch 9.x and/or the bundled java brought this changes.
https://kernel.org/doc/Documentation/sysctl/vm.txt
(external, opens in a new tab or window)
see:
"
max_map_count:
This file contains the maximum number of memory map areas a process may have. Memory map areas are used as a side-effect of calling malloc, directly by mmap, mprotect, and madvise, and also when loading shared libraries.
While most applications need less than a thousand maps, certain
programs, particularly malloc debuggers, may consume lots of them,
e.g., up to one or two maps per allocation.
The default value is 65536.
"