|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25623 Memory leak in function load()
Submitted: 2003-09-21 22:38 UTC Modified: 2003-12-06 07:06 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: maoy at fjii dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.3.3 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: maoy at fjii dot com
New email:
PHP Version: OS:


 [2003-09-21 22:38 UTC] maoy at fjii dot com
Web Server: Apache 1.3.26
When I get value of a field as Clob type, it always cause memory leak.

Reproduce code:

$conn = ocilogon("username","password");
$query = "SELECT clob_fldname FROM tablename";
$stmt = OCIParse ($conn, $query);
OCIExecute($stmt, OCI_DEFAULT);
$result = OCIResult($stmt, "clob_fldname");
if (is_object ($result)) $result = $result->load();



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-21 22:55 UTC] maoy at fjii dot com
memory leak size relate with value of the field, it also increase along with running times
 [2003-09-22 05:09 UTC]
could you plz replace  
$result = OCIResult($stmt, "clob_fldname"); 
if (is_object ($result)) $result = $result->load(); 
ocifetchinto($stmt, $arr,OCI_ASSOC); 
$result = $arr["CLOB_FLDNAME"]->load(); 
as this is the code i use all the time and it doesn't 
(seem) to leak for me. 
 [2003-09-22 06:04 UTC] maoy at fjii dot com
In fact, I tried to use following codes:

ocifetchinto($stmt, $arr,OCI_ASSOC); 
$result = $arr["CLOB_FLDNAME"]->load(); 

but it always cause memory leak on Windows system. It doesn't cause memory leak on Linux system.

By the way, running environment is:
Windows XP
Apache 1.3.26
PHP 4.3.3
Oracle 8.1.7

I am looking forward to reply.
 [2003-09-24 05:41 UTC]
sorry, if the leak does not show on unix there's not much 
i can do as i don't run windows. 
can you compile a debug-build and see if php actually 
complains about mem-leaks? 
 [2003-10-09 20:08 UTC] maoy at fjii dot com
I'm not able to compile a debug-build, but it's undoubted that the function cause memory leak. Please help me as soon as possible.

I am looking forward to reply. Thank you very much.
 [2003-10-23 23:03 UTC] maoy at fjii dot com
I had a try to run the following code on windows and linux, it cause memory leak on both platform. The size of memory leak depends on the size of CLOB-field's value and record count.

$conn = ocilogon("username","password","sid");
$query = "SELECT CLOB_FldName FROM tablename";
$stmt = OCIParse ($conn, $query);
while(ocifetchinto($stmt, $arr,OCI_ASSOC)){ 
  $result = $arr["CLOB_FldName"]->load(); 
  ecco $result;
 [2003-11-17 21:49 UTC]
You can find debug enabled win32 builds here:

 [2003-11-17 21:50 UTC]
And do answer Thies' question: Does _PHP_ report any leaks when compiled with --enable-debug (on linux)

 [2003-11-18 03:31 UTC] maoy at fjii dot com
when I replaced ORACLE 8.1.7 against ORACLE 9.2, the situation disappeared.
 [2003-12-06 07:06 UTC]
fixed by upgradeing oracle (see last comment of 

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 18:01:29 2024 UTC