zoukankan      html  css  js  c++  java
  • linux参数之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.”

           max_map_count文件包含限制一个进程可以拥有的VMA(虚拟内存区域)的数量。虚拟内存区域是一个连续的虚拟地址空间区域。在进程的生命周期中,每当程序尝试在内存中映射文件,链接到共享内存段,或者分配堆空间的时候,这些区域将被创建。调优这个值将限制进程可拥有VMA的数量。限制一个进程拥有VMA的总数可能导致应用程序出错,因为当进程达到了VMA上线但又只能释放少量的内存给其他的内核进程使用时,操作系统会抛出内存不足的错误。如果你的操作系统在NORMAL区域仅占用少量的内存,那么调低这个值可以帮助释放内存给内核用。

    调整示例,如下调整为默认的4倍

    此操作需要root权限

    [root@localhost ~]# sysctl -w vm.max_map_count=262144

    查看修改结果

    [root@localhost ~]# sysctl -a|grep vm.max_map_count
    vm.max_map_count = 262144
     
  • 相关阅读:
    数据库
    HTTP请求(Request)和回应(Response)对象
    [Uliweb]-URL映射
    git生成Key操作保存到GITHUB中
    SQL中char、varchar、nvarchar的区别
    Uliweb之 ORM基本使用(Sqlalchemy)
    ORM查询
    CentOS更改ssh端口
    django static文件的引入方式
    Redis持久化策略(RDB &AOF)
  • 原文地址:https://www.cnblogs.com/duanxz/p/3567068.html
Copyright © 2011-2022 走看看