Re: OutOfMemory causing connection leaks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: David Blasby <dblasby(at)openplans(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: OutOfMemory causing connection leaks
Date: 2006-03-24 20:51:29
Message-ID: 9140.1143233489@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka <books(at)ejurka(dot)com> writes:
> On Fri, 24 Mar 2006, David Blasby wrote:
>> [OutOfMemory errors leave protocol stream in unknown state]

> Yeah, that's a problem alright. The easiest thing to do is to treat an
> out of memory error like an IOException and destroy the whole connection
> immediately. This isn't terribly friendly though and the vast majority
> of the errors are going to come from ReceiveTupleV3, so we could put some
> checks in that path that could get the protocol back into a known state.
> Adding checks around every allocation isn't going to be worth the effort.

We went through this same evolution with libpq awhile back, and pretty
much did what you say above: make sure that OOM during tuple collection
was handled in a friendly way. OOM at other places is likely to leave
things a bit broken. So far there've not been many complaints ...

regards, tom lane

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Fichtenelch 2006-03-24 21:14:32 Re: Exception using dollar-quoted string
Previous Message Kris Jurka 2006-03-24 19:15:27 Re: OutOfMemory causing connection leaks