From datatanger@hotmail.fr Mon Jun 1 08:15:48 2026 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TDyLJ-0006Ji-7F for pgsql-docs@postgresql.org; Tue, 18 Sep 2012 14:00:01 +0000 Received: from dub0-omc1-s28.dub0.hotmail.com ([157.55.0.227]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TDyLH-000435-4E for pgsql-docs@postgresql.org; Tue, 18 Sep 2012 14:00:00 +0000 Received: from DUB103-W29 ([157.55.0.238]) by dub0-omc1-s28.dub0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 18 Sep 2012 06:59:53 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_2a1af631-2f84-4243-a43a-475a955bcebd_" X-Originating-IP: [41.142.255.38] From: data tanger To: Subject: Issue with SHMALL parameter Date: Tue, 18 Sep 2012 15:59:53 +0200 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 18 Sep 2012 13:59:53.0753 (UTC) FILETIME=[E0D0B890:01CD95A5] X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/16 X-Sequence-Number: 7468 --_2a1af631-2f84-4243-a43a-475a955bcebd_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi=2C I'm using postgresql 9.1 as my database server on a linux server that has 8= GB of RAM. After I changed the shared_buffers parameter to 2GB=2C I get the following = error when I try to start postgres: FATAL: could not create shared memory segment: Cannot allocate memoryDETAI= L: Failed system call was shmget(key=3D5432001=2C size=3D2221539328=2C 036= 00). Here are the shmall and the shmax params of my server: #cat /proc/sys/kernel/shmmax 68719476736 #cat /proc/sys/kernel/shmall 4294967296 So as you see=2C shmall is greater than the requested size by postgres. Any= one have and idea? thank you = --_2a1af631-2f84-4243-a43a-475a955bcebd_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi=2C

I'm using postgresql 9.1 as my database server on = a linux server that has 8 GB of RAM.

After I chang= ed the shared_buffers parameter to 2GB=2C I get the following error when I = try to start postgres:

FATAL:  =3Bcould not create shared memory segment: Cannot allocate me= mory
DETAIL:  =3BFailed system= call was shmget(key=3D5432001=2C size=3D2221539328=2C 03600).
=

Here are the shmal= l and the shmax params of my server:

#cat /proc/sys/kernel/shmmax  =3B  =3B = =3B
68719476736

#cat /proc/sys/kernel/shmall  =3B  =3B =3B
4294967296

So as you see=2C shmall= is greater than the requested size by postgres. Anyone have and idea?

thank you
= --_2a1af631-2f84-4243-a43a-475a955bcebd_-- From tgl@sss.pgh.pa.us Mon Jun 1 08:15:48 2026 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TE0L6-0002WW-0n for pgsql-docs@postgresql.org; Tue, 18 Sep 2012 16:07:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TE0Kz-0001w0-26 for pgsql-docs@postgresql.org; Tue, 18 Sep 2012 16:07:55 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q8IG7kio020114; Tue, 18 Sep 2012 12:07:46 -0400 (EDT) From: Tom Lane To: data tanger cc: pgsql-docs@postgresql.org Subject: Re: Issue with SHMALL parameter In-reply-to: References: Comments: In-reply-to data tanger message dated "Tue, 18 Sep 2012 15:59:53 +0200" Date: Tue, 18 Sep 2012 12:07:46 -0400 Message-ID: <20113.1347984466@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) X-Archive-Number: 201209/17 X-Sequence-Number: 7469 data tanger writes: > Here are the shmall and the shmax params of my server: > #cat /proc/sys/kernel/shmmax 68719476736 > #cat /proc/sys/kernel/shmall 4294967296 SHMALL is measured in pages not bytes on Linux. I wonder if that value is too large and is causing an internal integer overflow in the kernel. regards, tom lane From datatanger@hotmail.fr Mon Jun 1 08:15:48 2026 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TE2EO-0005fN-Jr for pgsql-docs@postgresql.org; Tue, 18 Sep 2012 18:09:08 +0000 Received: from dub0-omc2-s3.dub0.hotmail.com ([157.55.1.142]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TE2EL-0007vw-LZ for pgsql-docs@postgresql.org; Tue, 18 Sep 2012 18:09:07 +0000 Received: from DUB103-W42 ([157.55.1.137]) by dub0-omc2-s3.dub0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 18 Sep 2012 11:07:55 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_0aabdf70-83ef-422c-b941-e7e3cbd8678c_" X-Originating-IP: [41.142.255.38] From: data tanger To: CC: Subject: Re: Issue with SHMALL parameter Date: Tue, 18 Sep 2012 20:07:54 +0200 Importance: Normal In-Reply-To: <20113.1347984466@sss.pgh.pa.us> References: , <20113.1347984466@sss.pgh.pa.us> MIME-Version: 1.0 X-OriginalArrivalTime: 18 Sep 2012 18:07:55.0142 (UTC) FILETIME=[86D07A60:01CD95C8] X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/18 X-Sequence-Number: 7470 --_0aabdf70-83ef-422c-b941-e7e3cbd8678c_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thank you for your answer. I think the value of shmall I have is very commo= n cause I've seen it many times in other servers.Do you think there maybe a= link between the request size of postgres and the swap size? Here is the output of free -m free -m total used free shared buffers c= achedMem: 7867 1860 6007 0 5 = 595-/+ buffers/cache: 1258 6609Swap: 1023 2 = 1021 Regards=2C > From: tgl@sss.pgh.pa.us > To: datatanger@hotmail.fr > CC: pgsql-docs@postgresql.org > Subject: Re: [DOCS] Issue with SHMALL parameter > Date: Tue=2C 18 Sep 2012 12:07:46 -0400 >=20 > data tanger writes: > > Here are the shmall and the shmax params of my server: > > #cat /proc/sys/kernel/shmmax 68719476736 > > #cat /proc/sys/kernel/shmall 4294967296 >=20 > SHMALL is measured in pages not bytes on Linux. I wonder if that value > is too large and is causing an internal integer overflow in the kernel. >=20 > regards=2C tom lane = --_0aabdf70-83ef-422c-b941-e7e3cbd8678c_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thank you for your answer. I think the value of shmall I have is very commo= n cause I've seen it many times in other servers.
Do you think there ma= ybe a link between the request size of postgres and the swap size?

Here is the output of free -m

free -m
 =3B  =3B  =3B  =3B  =3B  =3B &= nbsp=3Btotal  =3B  =3B  =3B used  =3B  =3B  =3B fre= e  =3B  =3B shared  =3B  =3Bbuffers  =3B  =3B cache= d
Mem:  =3B  =3B  =3B  =3B  =3B7867  =3B =  =3B  =3B 1860  =3B  =3B  =3B 6007  =3B  =3B &n= bsp=3B  =3B  =3B0  =3B  =3B  =3B  =3B  =3B5 &nb= sp=3B  =3B  =3B  =3B595
-/+ buffers/cache:  =3B &= nbsp=3B  =3B 1258  =3B  =3B  =3B 6609
Swap:  = =3B  =3B  =3B  =3B 1023  =3B  =3B  =3B  =3B &nb= sp=3B2  =3B  =3B  =3B 1021

Regards=2C<= /div>
>=3B From: tgl@sss.pg= h.pa.us
>=3B To: datatanger@hotmail.fr
>=3B CC: pgsql-docs@postgr= esql.org
>=3B Subject: Re: [DOCS] Issue with SHMALL parameter
>= =3B Date: Tue=2C 18 Sep 2012 12:07:46 -0400
>=3B
>=3B data tange= r <=3Bdatatanger@hotmail.fr>=3B writes:
>=3B >=3B Here are the s= hmall and the shmax params of my server:
>=3B >=3B #cat /proc/sys/ke= rnel/shmmax 68719476736
>=3B >=3B #cat /proc/sys/kernel/shmall = 4294967296
>=3B
>=3B SHMALL is measured in pages not bytes on= Linux. I wonder if that value
>=3B is too large and is causing an in= ternal integer overflow in the kernel.
>=3B
>=3B regards=2C t= om lane
= --_0aabdf70-83ef-422c-b941-e7e3cbd8678c_--