When doing the post-install setup of postgresql default database using initdb, you may hit this error:
FATAL: could not create shared memory segment: Cannot allocate memory
DETAIL: Failed system call was shmget(key=1, size=1646592, 03600).You can either change the postgresql configuration to use less shared memory, or increase the system setting.
I suggest the latter, because this problem seems to stem from other running apps using some of the shared memory allowance, and I'd be nervous about them running out anyway if postgresql was still using a decent amount. IMHO, the default OS X limit is way too low.
Easy to fix; run:
sudo sysctl -w kern.sysv.shmall=65536
sudo sysctl -w kern.sysv.shmmax=16777216This changes the limits in the currently-running kernel. To make these values stick across reboots, add them to /etc/sysctl.conf, like this:
kern.sysv.shmall=65536
kern.sysv.shmmax=16777216
Comments
Thanks a lot for this hint. I found a lot of recommendations to increase shmmax, but as you mentioned, shmall is the key.
Muchas gracias, llevaba ya varias horas sin lograr nada.
Tu explicación fue clara y concisa.
-----
Thank you very much, i spent several hours without achieving anything.
Your explanation was clear and concise.
Gracias.
México
De nada :).
Dude, ...thx!
Thanks for this, I had this set properly upon install, but the latest security update for Snow Leopard reset shmall...
Awesome, thanks!
Also fixes the issue on Snow Leopard, by the way. Thanks a lot!
Fixed PG 8.4.4.1 on OS 10.6.5
Thanks!
To get this to work on my 2007 MacBook Pro,
I had to use:
kern.sysv.shmmax=67108864
(That is 16777216*4)
My Postgres was requesting 36872192.
Fixed PostgreSQL 9.0.4 on OS X 10.7.
Thanks a lot.
Thank you :)
This fixed it for me, and I added the fix to a Homebrew issue: https://github.com/mxcl/homebrew/issues/3162
They ended up pointing people here. http://www.postgresql.org/docs/current/static/kernel-resources.html#SYSVIPC
It has instructions on doing the same thing, but there's a lot more reading to do. Your concise explanation and instructions are much appreciated!
Thank You for being the member of this website. Please allow me to have the opportunity to show my satisfaction with HostGator web hosting. They offer professional and express support and they also offering some <a href=http://cort.as/1KYm><b>HostGator discount coupons</b></a>.
I love HostGator hosting, You will too.
The official Twitter account of HostGator.com, a leading provider of web hosting, reseller hosting, VPS HostGator Web Hosting - $3.96/month | HostGator Reviews
HostGator Web Hosting Information Resource Site. Get the latest updates on Hostgator Web Hosting.
Hostgator Review - Do They Live Up To The Hype?
Our Hostgator review dives deep into their service. In this review you will learn exactly what you will get if you decide to use them as a hosting provider.
HostGator India is a leading provider of web hosting, reseller hosting, vps hosting , and dedicated servers. Over 5000000 websites trust HostGator for their web ...
HostGator is a Houston-based web hosting company with an additional presence in Austin, Texas. It was founded in 2002 by Brent Oxley, who was then a HostGator Review - 35 Customer Reviews of HostGator
HostGator Reviews: 3.19 out of 5, based on 35 customer reviews of HostGator. Check our HostGator reviews and ratings before signing up with HostGator.
I need dedicated servers for downloading | HostGator Coupons Code
hi i want to upload many big files & share them with direct links & many people will download them so i want unlimetid traffic also i want them to.
Hostgator Coupon With Free Link Building Campaign.
Use our Hostgator Coupon site and get Free SEO, Free Link Building and Free Website Traffic. Forget the rest! Hostgator coupon code 2011, hostgator coupon code 2012