Search Postgresql Archives

Re: High memory usage with savepoints & encoding differences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Dylan Adams" <dadams@xxxxxxxxxxxx> writes:
> I'm running into a situation where postmaster is consuming significantly
> more memory than I would expect. This only seems to happen when I
> combine savepoints with differences between client and database
> encoding. I originally discovered this while running some Java code
> which uses JDBC (the postgres JDBC driver always sets client_encoding to
> UNICODE) to connect to a latin1 encoded database, but it's reproducible
> with psql as well.

I think this example is pretty artificial.  The fundamental reason
memory is increasing is that each subtransaction can require some state
storage.  In the example the per-subtransaction CurTransactionContexts
are not getting used for anything except encoding conversion on the
SAVEPOINT/RELEASE command completion messages --- but if you were doing
any real work in the subtransactions then most likely there would be
additional stuff there, so I'm not excited about trying to suppress
this particular symptom.

The bottom line is that lots and lots of subtransactions isn't a very
good thing for performance, especially with a couple of network round
trips for each one.  Consider pushing whatever work is involved here
into a server-side function.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux