Jeff Janes <jeff.janes@xxxxxxxxx> writes: > On Thu, Jan 15, 2015 at 3:30 AM, Huan Ruan <huan.ruan.it@xxxxxxxxx> wrote: >> I thought 'shared_buffers' sets how much memory that is dedicated to >> PostgreSQL to use for caching data, therefore not available to other >> applications. > While PostgreSQL has reserves the right to use 32GB, as long as PostgreSQL > has not actually dirtied that RAM yet, then the kernel is free to keep > using it to cache files. Another thing to keep in mind is that, even if Postgres *has* used the RAM, the kernel might decide to swap parts of it out if it's not being used heavily. This is pretty disastrous from a performance standpoint, so it's advisable to not make shared_buffers very much larger than what your application will keep "hot". Ideally we'd lock the shared buffer arena into RAM to prevent that, but such facilities are often unavailable or restricted to root. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance