Shmmax: Difference between revisions

From ThinkServer
>Samthecrazyman
Created, from Dokuwiki
 
>Samthecrazyman
m Small tidy up
 
Line 1: Line 1:
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.
shmmax is a kernel parameter that defines how much shared memory a program can be allocated. You may need to increase or decrease this limit for a program to work or for security. This guide will show you how.


== What you need to know ==
== What you need to know ==
Line 8: Line 8:


# Open KWrite.
# Open KWrite.
# Goto 'File' and then 'Open'.
# Go to 'File' and then 'Open'.
# You'll need to click 'root' down the left hand side (usually the red folder). Navigate to <code>etc</code>. You then need to find the file <code>sysctl.conf</code> (The full path to the file is <code>/etc/sysctl.conf</code>).
# You'll need to click 'root' down the left hand side (usually the red folder). Navigate to <code>etc</code>. You then need to find the file <code>sysctl.conf</code> (The full path to the file is <code>/etc/sysctl.conf</code>).
# Click at the bottom of the typable area, ready to type.
# Click at the bottom of the typable area, ready to type.
# Type or copy and paste the following statement: <code>kernel.shmmax = <value></code> (<code><value></code> needs replacing with the amount of shared memory you want each program to be allowed. This value is in '''bytes'''.
# Type or copy and paste the following statement: <code>kernel.shmmax = <value></code> (<code><value></code> 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)'.
# 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.
# Close KWrite and restart your system.

Latest revision as of 14:19, 22 May 2012

shmmax is a kernel parameter that defines how much shared memory a program can be allocated. You may need to increase or decrease 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

  1. Open KWrite.
  2. Go to 'File' and then 'Open'.
  3. You'll need to click 'root' down the left hand side (usually the red folder). Navigate to etc. You then need to find the file sysctl.conf (The full path to the file is /etc/sysctl.conf).
  4. Click at the bottom of the typable area, ready to type.
  5. 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).
  6. 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)'.
  7. Close KWrite and restart your system.
  8. Once restarted, open Konsole.
  9. At the command line, type cat /proc/sys/kernel/shmmax.
  10. 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.