sysctl -w vm.max_map_count=262144
is correct, however, the setting will only last for the duration of the session. If the host reboots, the setting will be reset to the original value.
If you want to set this permanently, you need to edit /etc/sysctl.conf
and set vm.max_map_count
to 262144.
When the host reboots, you can verify that the setting is still correct by running sysctl vm.max_map_count