Skip site navigation (1) Skip section navigation (2)

Re: Linux server connection process consumes all memory

From: "Ioannis Anagnostopoulos" <ioannis(at)anatec(dot)com>
To: "Alan Hodgson" <ahodgson(at)simkin(dot)ca>,<pgsql-novice(at)postgresql(dot)org>
Subject: Re: Linux server connection process consumes all memory
Date: 2011-12-04 11:08:35
Message-ID: B56C2BFC6806BE4A9C86ADDDD269933A6E8A10@appserver.anatec.local (view raw or flat)
Thread:
Lists: pgsql-novice
Hello Alan,

From the code I posted I am pretty sure that my prepared statement is 
a const/shared thus it is the same among the instances of the class. However
as I said you may try it with a non prepared command. The result will be exactly the same.

What I tend to believe is that this is some kind of memory that is 
held ON the server via the connection by the client application. For this reason when the client
exits all memory on the server returns to normal. On the JAVA world I had a similar happening when
the connection was accumulating too many "server notices" that were not consumed by the client. These noticed 
had to be cleared manually in order to reduce the memory usage. To this day I have not seen something similar 
in the .net world (in both flavours of ado.net driver i.e comercial and NPGSQL).

Kind Regards
Yiannis


-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org on behalf of Alan Hodgson
Sent: Sun 04/12/2011 06:17
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Linux server connection process consumes all memory
 
On Saturday, December 03, 2011 05:43:30 PM Ioannis Anagnostopoulos wrote:
> Hi thank you for the answer, I am referring to the postgres process
> on the Linux server corresponding to the connection I have established.
> After doing a TOP you may see quite a few postgres processes. One of them
> belongs to the connection established by the client application. It is this
> process that grows consuming memory.
> 

Tom has posted a request for some follow-up information that might help track 
this down.

One thought, though, is it possible you are creating a new prepared statement 
for each query instead of re-using one? And then not relelasing them?  I did a 
quick test and creating millions of prepared statements will chew up a lot of 
memory pretty quick in the backend.

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2011-12-04 16:30:04
Subject: Re: Linux server connection process consumes all memory
Previous:From: Ioannis AnagnostopoulosDate: 2011-12-04 10:44:41
Subject: Re: Linux server connection process consumes all memory

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group