Shmmax
shmmax is a kernel parameter that defines how much shared memory a program can be allocated. You may need to up or down this limit for a program to work or for security. This guide will show you how.
What you need to know
This is a pretty simple procedure. All you need to know is how to use KWrite and Konsole.
Changing shmmax permanently
- Open KWrite.
- Goto 'File' and then 'Open'.
- You'll need to click 'root' down the left hand side (usually the red folder). Navigate to
etc
. You then need to find the filesysctl.conf
(The full path to the file is/etc/sysctl.conf
). - Click at the bottom of the typable area, ready to type.
- Type or copy and paste the following statement:
kernel.shmmax = <value>
(<value>
needs replacing with the amount of shared memory you want each program to be allowed. This value is in bytes. - Once you have the statement in place, click the 'Save' button across the top toolbar (usually with a floppy disk icon). The title at the top of the window should not read '(Modified)'.
- Close KWrite and restart your system.
- Once restarted, open Konsole.
- At the command line, type
cat /proc/sys/kernel/shmmax
. - The value should now read the same as the
<value>
you entered earlier.
Troubleshooting
- Remember that the
<value>
must be in bytes. - 512MB in PostgreSQL gives the value 572383232 bytes.