pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Postgres resources not released after call PQclear
2+ messages / 2 participants
[nested] [flat]

* Postgres resources not released after call PQclear
@ 2014-04-07 16:03  Souheila Hechaichi <Souheila.Hechaichi@asg.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Souheila Hechaichi @ 2014-04-07 16:03 UTC (permalink / raw)
  To: pgsql-bugs


Hello;
I observe that when the row number about a SELECT SQL request is equal to zero, the function PQclear does not release the allocated resources and a memory leak are detected into my application.
To reproduce the problem I do the following steps:

-          To detect the memory leak I have enabled them via the Microsoft procedure .

Include the following files

#define _CRTDBG_MAP_ALLOC

#include <stdlib.h>

#include <crtdbg.h>



And I call the function _CrtDumpMemoryLeaks() at the end of my application, to display all the memory leak.


-          I call the PQexec function to execute the SQL request and after it end I call PQclear to release the allocated ressouces.

Can you give me a help about this bug?
Best regards;


[cid:image001.png@01CF528A.DD5651E0]<http://www.asg.com/;

Souheila Hechaichi, Software Engineer

souheila.hechaichi@asg.com<mailto:souheila.hechaichi@asg.com> |  33.164.868386
www.asg.com<http://www.asg.com/; |

[cid:image002.png@01CF528A.DD5651E0]<https://www.facebook.com/ASGSoftwareSolutions;[cid:image003.png@01CF528A.DD5651E0]<https://twitter.com/#!/asgsoftware;[cid:image004.png@01CF528A.DD5651E0]<https://www.linkedin.com/company/asg;[cid:image005.png@01CF528A.DD5651E0]<https://www.youtube.com/asgtech;


Registergericht/Registered Office: Amtsgericht München HRA 72107
Geschäftsführer/General Manager: Arthur Allen
Umsatzsteuernummer/VAT No.: DE 192144187
P  Please consider the environment before printing this email.

Attachments:

image001.png (image/png, 3.3K) download view image
image002.png (image/png, 1.1K) download view image
image003.png (image/png, 1.4K) download view image
image004.png (image/png, 1.2K) download view image
image005.png (image/png, 1.7K) download view image
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: Postgres resources not released after call PQclear
@ 2014-04-07 16:34  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Souheila Hechaichi <Souheila.Hechaichi@asg.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2014-04-07 16:34 UTC (permalink / raw)
  To: Souheila Hechaichi <Souheila.Hechaichi@asg.com>; +Cc: pgsql-bugs

Souheila Hechaichi <Souheila.Hechaichi@asg.com> writes:
> I observe that when the row number about a SELECT SQL request is equal to zero, the function PQclear does not release the allocated resources and a memory leak are detected into my application.

This claim is, to be frank, pretty astonishing.  Can you produce a
self-contained test case to demonstrate that there's a leak?

> And I call the function _CrtDumpMemoryLeaks() at the end of my application, to display all the memory leak.

I doubt that that proves anything at all.  Such a function can't tell
whether libpq is holding onto memory internally.  If you see growth in
memory usage over repeated query cycles, then it would be interesting.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2014-04-07 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-04-07 16:03 Postgres resources not released after call PQclear Souheila Hechaichi <Souheila.Hechaichi@asg.com>
2014-04-07 16:34 ` Tom Lane <tgl@sss.pgh.pa.us>

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