Where does Linux set the default values for SHMMAX?

7,118

On the fly you can just echo into /proc/sys/kernel/shmmax!

# echo 20446744073692774399 > /proc/sys/kernel/shmmax

But most people edit /etc/sysctl.conf with a line similar to:

kernel.shmmax=your_new_value_here

See the sysctl(8) man page.

Share:
7,118

Related videos on Youtube

Brandon Condrey
Author by

Brandon Condrey

Consider opposing apartheid in Palestine and signing onto the BDS Movement; #1 User for DBA.SE 2017. Available for contracting: 281.901.0011 PostgreSQL & PostGIS / MySQL / SQL Server JavaScript, Typescript, Rx.js, Node.js, Angular Also: C / Perl / Python / Rust / x86 Assembly

Updated on September 18, 2022

Comments

  • Brandon Condrey
    Brandon Condrey over 1 year

    I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.

    $ cat /proc/sys/kernel/shmmax 
    18446744073692774399
    
    $ sysctl kernel.shmmax
    kernel.shmmax = 18446744073692774399
    
  • Brandon Condrey
    Brandon Condrey almost 7 years
    That's not the question. Where are the defaults set? That is, if you don't write to shmmax yourself, what does it default to?
  • Deathgrip
    Deathgrip almost 7 years
    On some Linux distros (RHEL 5&6 I believe is one) it is set in /etc/sysctl.conf. But I think the default is set in the kernel code to the theoretical limit (guessing that's 2^64 - 1?).