-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FATAL: could not create shared memory segment: Cannot allocate memory #43
Comments
Same problem with the same specs. It had been running fine for two years. |
This has been a perplexing problem for me on a Mac as well. Restarting the laptop is one way around it. The error message indicates that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMALL parameter. You will need to reconfigure the kernel with a larger SHMALL to resolve this issue. To increase the SHMALL parameter on your Mac, you can use the You can first check the current values of SHMALL and SHMMAX using the following commands:
To temporarily (until the next restart) increase these values, you can use the -w option with sysctl:
These commands increase the SHMALL and SHMMAX parameters to 1GB. Please note that these changes will be lost after a system reboot. To make these changes permanent, you can add these settings to the /etc/sysctl.conf file:
After modifying these settings, you will need to restart your PostgreSQL server for the changes to take effect. If you continue to have issues after increasing these parameters, you might also need to increase the shared_buffers setting in your postgresql.conf file. This setting determines the amount of memory allocated to PostgreSQL for caching data. You can find this file in the PostgreSQL data directory, which is typically /usr/local/var/postgres for a Homebrew installation.
Again, you will need to restart the PostgreSQL server for changes to take effect. Remember that these changes can affect the overall performance of your system. You should monitor your system's performance and adjust these values as needed. |
testing.postgresql Version
Debug Output
Expected Behavior
As a developper I expect no error about memory.
Actual Behavior
Several times a day I have a memory shared error, the lib cannot allocate memory. The only solution who solve my problem is to restart my computer.
Steps to Reproduce
I launch in debug mode and I kill the process then I have the problem.
Randomly sometime when a test in development crash then I have the problem
The text was updated successfully, but these errors were encountered: