X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 7E02511F610C for ; Tue, 25 Apr 2006 10:44:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 18057-03 for ; Tue, 25 Apr 2006 10:43:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from pgfoundry.org (pgfoundry.org [200.46.204.130]) by postgresql.org (Postfix) with ESMTP id 3BB3D11F607B for ; Tue, 25 Apr 2006 10:43:55 -0300 (ADT) Received: from localhost (mx1.hub.org [200.46.208.251]) by pgfoundry.org (Postfix) with ESMTP id 1F2E586C516; Tue, 25 Apr 2006 13:43:57 +0000 (UTC) Received: from pgfoundry.org ([200.46.204.130]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 19396-02; Tue, 25 Apr 2006 10:43:47 -0300 (ADT) Received: by pgfoundry.org (Postfix, from userid 80) id 0693E86C517; Tue, 25 Apr 2006 13:43:48 +0000 (UTC) To: noreply@pgfoundry.org From: Subject: [ psqlodbc-Bugs-1000619 ] Possible memory leaks during execution of INSERT and UPDATE statements. Content-type: text/plain; charset=UTF-8 Message-Id: <20060425134348.0693E86C517@pgfoundry.org> Date: Tue, 25 Apr 2006 13:43:48 +0000 (UTC) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/90 X-Sequence-Number: 7617 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 view("event"); // build an inserter for the view DBView::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