You will write something like
vm.overcommit_memory = (a integer from 0 to 2)where
0 - means that the kernel will use predefined heuristics when deciding whether to allow such an overcommit. This is the default.
1 -always overcommits (Very dangerous)
2 - Prevents overcommits from exceeding a certain value. Within this mode, the total commit can not exceed the swap space(s) size + overcommit_ratio percent * RAM size. By default, the overcommit ratio is 50.
For example, do look at Memory Management - Preventing the kernel from dishing out more memory than required