tweaking kern.ipc.shmmax

Dino Vliet dino_vliet at
Wed Feb 28 23:05:05 UTC 2007

Hi peeps,

I have a amd64 system running freebsd6.1 with 3 GB ram. I want to use this a s my primary reserach database and installed postgresql on it. There they are talking about increasing some shared buffers value.

However, if I do increase that shared buffer value to even 64MB (while I hoped to increase it up to 256MB), in the var/log/messages file I get this error:

Feb 28 23:43:09 zouk postgres[826]: [1-1] FATAL:  could not create shared memory segment: Cannot allocate memory
Feb 28 23:43:09 zouk postgres[826]: [1-2] DETAIL:  Failed system call was shmget(key=5432001, size=71942144, 03600).
Feb 28 23:43:09 zouk postgres[826]: [1-3] HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space.
Feb 28 23:43:09 zouk postgres[826]: [1-4]  To reduce the request size (currently 71942144 bytes), reduce PostgreSQL's shared_buffers parameter (currently 8192) and/or its
Feb 28 23:43:09 zouk postgres[826]: [1-5]  max_connections parameter (currently 3).
Feb 28 23:43:09 zouk postgres[826]: [1-6]       The PostgreSQL documentation contains more information about shared memory configuration.

However, look at the values I have put in my /etc/rc.conf file:

sysctl -w kern.ipc.shmmax=1954311424
sysctl -w kern.ipc.shmall=16384

I don't understand why the value that seems smaller, 71942144, doesn't fit in the shmmax value.

Can anyone be of assistance? Do I need to rebuild my kernel? Someone advised in 2006 that these value should be in your kernel:
 options         PMAP_SHPGPERPROC=201
options         KVA_PAGES=260

The fact is that tha both are not in my current kernel, but even if they did, I wouldn't know which values to give them.
Can anyone help me out?


Any questions? Get answers on any topic at  Try it now.

More information about the freebsd-questions mailing list