Find the answer to your Linux question:
Results 1 to 3 of 3
I've run into what I assume is some kind of system wide or process limit with regard to the number of outstanding mmap()ed areas in memory. I'm running RHEL 4 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Location
    North East U.S.
    Posts
    30

    What is maximum number of mmaped areas?


    I've run into what I assume is some kind of system wide or process limit with regard to the number of outstanding mmap()ed areas in memory. I'm running RHEL 4 kernel 2.6.9-42.ELsmp. I get an error after 65494 mappings and perror reports : cannot allocate memory. I know this is a relatively large number of mapped areas at one time, but the total number I need is perhaps more than 1 million. I've run this on Solaris86 without error and I'm trying it on AIX now.

    Does anyone know what limit I'm hitting and how I may be able to increase the limit? Ideally I'd like to increase the limit without having to re-build the kernel - I don't want to ask customers to re-build all their kernels. Thanks!

    Brion

  2. #2
    Just Joined!
    Join Date
    Jun 2008
    Location
    North East U.S.
    Posts
    30
    I have run into this maximum number of mmap() regions limit again and it seems to be breached at close to 64K open mmap() calls. How does one query this limit and how does one create a higher limit? I have tried sysconf(_SC_MAPPED_FILES), but it returns 200112, which is much higher than the limit I'm running into. Can anyone help with this?

  3. #3
    Just Joined!
    Join Date
    Jun 2008
    Location
    North East U.S.
    Posts
    30
    I discovered that there is a kernel parameter max_map_count that defaults to 65536, but you can set it larger (or smaller). With root authority you can try

    sysctl -w vm.max_map_count=nnn

    and change the maximum number of mapped areas allowed for each process. This changes the kernel parameter at run time rather than boot time. You may also be able to alter the file "/proc/sys/vm/max_map_count" which is the text of the value for this parameter. There is a sysctl.conf file that can contain values for many system control parameters, including vm.max_map_count.

    You can use "sysctl vm.max_map_count" to find the current limit.

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •