PAGE_SIZE THREAD_SIZE STACKSIZE

如何查看Linux中的内存分布大小及线程大小及堆栈大小

  1. PAGE_SIZE

    系统运行时,不能修改,如果要修改需要编译修改,执行make menuconfig

    <root@SYS-OPS-TOOLS /># getconf PAGESIZE
    4096
  2. THREAD_SIZE

    不能手动修改,由PAGE_SIZE决定,具体代码地址如下

    https://elixir.bootlin.com/linux/v5.14.14/source/arch/x86/include/asm/page_64_types.h#L16

  3. STACKSIZE

    ulimit是针对每个用户而设置的参数,用户级别的

    <root@SYS-OPS-TOOLS /># ulimit -s
    8192
    <root@SYS-OPS-TOOLS /># ulimit -a
    core file size          (blocks, -c) 0
    data seg size           (kbytes, -d) unlimited
    scheduling priority             (-e) 0
    file size               (blocks, -f) unlimited
    pending signals                 (-i) 15063
    max locked memory       (kbytes, -l) 64
    max memory size         (kbytes, -m) unlimited
    open files                      (-n) 1000000
    pipe size            (512 bytes, -p) 8
    POSIX message queues     (bytes, -q) 819200
    real-time priority              (-r) 0
    stack size              (kbytes, -s) 8192
    cpu time               (seconds, -t) unlimited
    max user processes              (-u) 15063
    virtual memory          (kbytes, -v) unlimited
    file locks                      (-x) unlimited

     

posted @ 2022-05-19 17:37  MacoPlus  阅读(89)  评论(0编辑  收藏  举报