Skip to content

Instantly share code, notes, and snippets.

@zduymz
Created October 24, 2016 18:22
Show Gist options
  • Save zduymz/1fd8336426b86ca590ff2b20fc93c10e to your computer and use it in GitHub Desktop.
Save zduymz/1fd8336426b86ca590ff2b20fc93c10e to your computer and use it in GitHub Desktop.

From the Linux kernel documentation:

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 and mprotect, 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.

Bottom line: this setting limits the number of discrete mapped memory areas - on its own it imposes no limit on the size of those areas or on the memory that is usable by a process.

From stackoverflow: It does not determine directly how much memory a process can use. A process can allocate memory let's say in 64Kb chunks or 256Kb chunks, having 4x different total memory used. vm.max_map_count controls only number of these chunks.

I don't understand it clearly yet.

Side Effect when increasing vm.max_map_count https://www.novell.com/support/kb/doc.php?id=7000830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment