|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28978 multiple OCIBindByName on same placeholder eats memory
Submitted: 2004-06-30 21:44 UTC Modified: 2004-07-15 08:09 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: pumuckel at metropolis dot de Assigned: tony2001 (profile)
Status: Closed Package: OCI8 related
PHP Version: 4.3.7 OS: Linux
Private report: No CVE-ID: None
 [2004-06-30 21:44 UTC] pumuckel at metropolis dot de
Calling OCIBindByName on the same placeholder (same statement) does eat memory. The expected behaviour should be to just replace the old placeholder variable with the new one, without any new memory allocation needed.

Reproduce code:

  $conn = OCILogon("scott", "tiger", "database");
  $i = 1;
  while($i++) {
    OCIBindByName($stmt, ":DUMMY", &$dummy, 1);
    if ($i%500 == 0)
    echo "\rMEM -send $i: ".memory_get_usage();

Expected result:
The memory usage shouldn't grow.
A second call to ocibindbyname on the same placeholder should free/replace the old php internal bind variable (in oci8.c) for this placeholder...

Actual result:
actual a new bind place holder is allocated and added to the list of bind variables.

MEM -send 122500: 8387128
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 20 bytes) in /user/bug.php on line 16


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-05 11:33 UTC]
I'll take a look at it.
 [2004-07-12 09:42 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2004-07-15 01:46 UTC] pumuckel at metropolis dot de
Changes are not committed to 4.3.8 :-(
 [2004-07-15 08:09 UTC]
Yep, I consider it more as a feature request, than a bugfix, so I think it should go into HEAD only.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 21 18:03:39 2023 UTC