Re: Memory Usage and libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Keary Suska <hierophant(at)pcisys(dot)net>
Cc: Postgres-Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Memory Usage and libpq
Date: 2006-04-04 20:06:06
Message-ID: 14006.1144181166@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Keary Suska <hierophant(at)pcisys(dot)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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Keary Suska 2006-04-04 20:24:38 Re: Memory Usage and libpq
Previous Message Keary Suska 2006-04-04 19:14:52 Memory Usage and libpq