I have postgresql(Master and Slave) infrastructure. The postgresql server have 32 GB RAM and 600 MB swap space. We are using java(tomcat) applications. I have performed postgresql tuning using http://pgtune.leopard.in.ua/. But currently my issue is, my postgresql server caching and swap memory increasing periodically and certain point we forced to clear the cache or restart the postgresql. Could you please let me with the reason behind it. Below are my performance tuning parameter. Rest of the parameters are default. Also we are using pgbarman to take the point of time backup which configure on other server.
postgresql.conf
===============
max_connections = 300
shared_buffers = 8GB
effective_cache_size = 24GB
work_mem = 27962kB
maintenance_work_mem = 2GB
checkpoint_segments = 32
checkpoint_completion_target = 0.7
wal_buffers = 16MB
default_statistics_target = 100
/etc/sysctl.conf
================
kernel.shmmax=17179869184
kernel.shmall=4194304