BUG #4996: postgres.exe memory consumption keeps going up

From: "Shivesh Wangrungvichaisri" <sbw(at)appsig(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4996: postgres.exe memory consumption keeps going up
Date: 2009-08-19 15:50:44
Message-ID: 200908191550.n7JFoiJv019149@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers


The following bug has been logged online:

Bug reference: 4996
Logged by: Shivesh Wangrungvichaisri
Email address: sbw(at)appsig(dot)com
PostgreSQL version: 8.3.7
Operating system: Windows XP x64 / Windows 7 x64
Description: postgres.exe memory consumption keeps going up
Details:

Application: C++
Connector: libpq that came with 8.3.7
Problem: postgres.exe memory consumption keeps going up. (Working set and
Sharable as viewed from Windows Task Manager)
Steps to reproduce problem:
1) Create a test table
2) Using a C++ program, create 2 threads.
3) First thread will keep doing an INSERT of anything.
4) Second thread will keep doing a SELECT of anything.
5) Do NOT call PQfinish on PGconn. Rather, keep the connection opened after
each query is finished.
6) PGresult, of course, should be PQClear after every query.
7) Look in Windows Task manager. Since there were 2 threads that opened the
connection, there will be 2 postgres.exe whose memory consumption keeps
going up slowly.
8) In our real application, since we INSERT a large amount of data per
query, as well as SELECT a large amount of data per query, the memory leak
is much worse, and postgres.exe crashes after its memory consumption has
reached about 1.8GB.

Reference:
- What our command line looks like:

http://picasaweb.google.com/shivesh/PostgresqlCommandLine#537169872221980512
2
- Example code that should demonstrate the problem:
http://stackoverflow.com/questions/1280513/posgressql-memory-leaque (note we
use Intel TBB to launch threads..you can use whatever thread library you
want.)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2009-08-19 19:56:50 Re: BUG #4961: pg_standby.exe crashes with no args
Previous Message Tom Lane 2009-08-19 14:43:16 Re: BUG #4993: memory issue with array_agg

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2009-08-19 15:53:49 Re: explain root element for auto-explain
Previous Message Jeff Janes 2009-08-19 15:43:50 Re: REGRESS_OPTS versus MSVC build scripts