Postgres resources not released after call PQclear

Started by Souheila Hechaichiabout 12 years ago2 messagesbugs
Jump to latest
#1Souheila Hechaichi
Souheila.Hechaichi@asg.com

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/&gt;

Souheila Hechaichi, Software Engineer

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

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

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.pngimage/png; name=image001.pngDownload
image002.pngimage/png; name=image002.pngDownload
image003.pngimage/png; name=image003.pngDownload
image004.pngimage/png; name=image004.pngDownload
image005.pngimage/png; name=image005.pngDownload
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Souheila Hechaichi (#1)
Re: Postgres resources not released after call PQclear

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