There are several settings for controlling memory consumption and the way memory is consumed, and these settings are listed here:
- Shared buffers (shared_buffers): The amount of memory the database server uses for quick access to data. This amount of RAM is locked for the PostgreSQL server for reading and writing data. The default value for shared buffers is 128 MB; however, it's recommended to set it to around 25% of the total memory. Sometimes, increasing shared_buffers to a very high value leads to an increase in performance, because the database can be cached completely in the RAM. However, the drawback of increasing this value too much is that you can't allocate memory for CPU operations such as sorting and hashing.