no way to free failed query => memory leak
| Bug #25093 | no way to free failed query => memory leak | ||||
|---|---|---|---|---|---|
| Submitted: | 2003-08-14 06:51 UTC | Modified: | 2003-08-15 07:05 UTC | ||
| From: | php at pv2c dot sk | Assigned: | |||
| Status: | Closed | Package: | PostgreSQL related | ||
| PHP Version: | 4.3.2 | OS: | Linux | ||
| Private report: | No | CVE-ID: | None | ||
[2003-08-14 06:51 UTC] php at pv2c dot sk
Description: ------------ pg_query doesn't return resource for failed queries - that's not very wise, IMHO (see related bug 18747), but the real problem with this is, that you cannot free failed results. It may not be noticeable if you have only a few failed queries, but it becomes a serious problem if you have lots. Try the example code. Reproduce code: --------------- // assume one table "aaa" with one column "test", that is // unique (primary key maybe) $con=pg_connect(...); for($t=0; $t<10000; $t++) { $ret = pg_query($con, "INSERT INTO aaa (test) VALUES 1"); // $ret is FALSE (cannot inset duplicate value) => no way to free it } Expected result: ---------------- Some way to free the result resource... Actual result: -------------- PHP memory consumption grows *really fast*, in my case it even ignores memory_limit setting in php.ini.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-08-14 06:53 UTC] php at pv2c dot sk
[2003-08-15 07:05 UTC] sniper@php.net