pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Keary Suska <hierophant@pcisys.net>
Cc: Postgres-Interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: Memory Usage and libpq
Date: Tue, 04 Apr 2006 16:06:06 -0400
Message-ID: <14006.1144181166@sss.pgh.pa.us> (raw)
In-Reply-To: <C05813BC.27D74%hierophant@pcisys.net>
References: <C05813BC.27D74%hierophant@pcisys.net>

Keary Suska <hierophant@pcisys.net> writes:
> I am investigating a memory usage issue and I noticed something with libpq.
> It appears that libpq doesn't actually free memory allocated to store
> results, even after PQclear() is called. In a debug program I can inspect
> the buffer so I know it exists. I haven't verified whether the buffer is
> resized with subsequent calls, but when dealing with large result sets it
> creates a significant memory overhead.

This would depend entirely on how malloc/free are implemented on your
platform.  Some versions can release space back to the OS, some can't.
In some it depends on what else has been allocated.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <14006.1144181166@sss.pgh.pa.us>
Permalink:  ../14006.1144181166@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14006.1144181166@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hierophant@pcisys.net
  Subject: Re: Memory Usage and libpq
  In-Reply-To: <14006.1144181166@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox