pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: noreply@pgfoundry.org
To: noreply@pgfoundry.org
Subject: [ psqlodbc-Bugs-1000619 ] Possible memory leaks during execution of INSERT and UPDATE statements.
Date: Tue, 25 Apr 2006 13:43:48 +0000 (UTC)
Message-ID: <20060425134348.0693E86C517@pgfoundry.org> (raw)

Bugs item #1000619, was opened at 2006-04-25 13:43
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000619&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: Possible memory leaks during execution of INSERT and UPDATE statements.

Initial Comment:
I will use unicode PostgreSQL database version 8.0 on linux within the client application on W2K which use PostgreSQL Unicode driver version 08.01.0200 (default settings).
Client application use DTL (www.dtemplatelib.sourceforge.net) for SQL operations. 
What I have found when application perfroms only SELECT statements merory usage is stable. However when I add INSERT or UPDATE statements the memory usage have been slowly increasing during all program execution. I have made the same tests using the MSSQL database and they show stable memory usage. 
This convinces me that the most possible place of memory leaks is psqlODBC driver. 
The C++ code below show how I use DTL for make insertion 

       DBView<LoggingRow> view("event");

      // build an inserter for the view
      DBView<LoggingRow>::insert_iterator loggingInserter = view;
      LoggingRow loggingRow;  

      loggingRow.SetPersonID(personID);
      loggingRow.SetStreamID(streamID);
      loggingRow.SetLogEvent((int)logEvent);
      loggingRow.SetIP(ip);
      loggingRow.SetServerName(ServerName);
      loggingRow.SetSecondsFromStart(secondsFromStart);

      *loggingInserter = loggingRow;

      loggingInserter++;
      Commit();

This code generate next INSERT statement:
PREPARE "_PLAN00DC7D88"(int4, int4, int4, int4, varchar, varchar) as INSERT INTO EVENT (PERSON_ID, SECONDSFROMSTART, STREAM_ID, EVENTTYPE_ID, IPADDRESS, SERVERNAME) VALUES (($1), ($2), ($3), ($4), ($5), ($6));EXECUTE "_PLAN00DC7D88"(100,100,100,5,'0.0.0.0','test server')

Making 5000 simple INSERTS (console application just call the method which make insert 5000 times) into database increases memory usage of console application by more than 800Kb. The statistic below shows example of memory usage by console application (I used "Private Bytes" counter in perfom).

16:25:11.872","3993600"
16:25:12.872","4009984"
16:25:13.872","4030464"
16:25:14.872","4050944"
16:25:15.872","4075520"
16:25:16.872","4096000"
16:25:17.872","4112384"
16:25:18.872","4132864"
16:25:19.872","4153344"
16:25:20.872","4173824"
16:25:21.872","4198400"
16:25:22.872","4218880"


----------------------------------------------------------------------

You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000619&group_id=1000125



view thread (2+ messages)  latest in thread

Message-ID: <20060425134348.0693E86C517@pgfoundry.org>
Permalink:  ../20060425134348.0693E86C517@pgfoundry.org/
Also on:    postgresql.org/message-id/20060425134348.0693E86C517@pgfoundry.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: noreply@pgfoundry.org
  Subject: Re: [ psqlodbc-Bugs-1000619 ] Possible memory leaks during execution of INSERT and UPDATE statements.
  In-Reply-To: <20060425134348.0693E86C517@pgfoundry.org>
  References: <20060425134348.0693E86C517@pgfoundry.org>

* 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