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

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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

pgsql-hackers by date

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

pgsql-bugs by date

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

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