#43497 [Asn->Csd]: OCI8 XML/getClobVal leaks UGA memory
| From: | sixd@php.net | Date: | Wed, 16 Jan 2008 00:09:28 +0000 |
| Subject: | #43497 [Asn->Csd]: OCI8 XML/getClobVal leaks UGA memory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121320@lists.php.net to get a copy of this message | ||
ID: 43497
Updated by: sixd@php.net
Reported By: ghosh at q-one dot com
-Status: Assigned
+Status: Closed
Bug Type: OCI8 related
Operating System: Linux 2.6.22-14-server
PHP Version: 5.2.5
Assigned To: sixd
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
+----------------------------------------------------------
| Fixed in 5.2.6, 5.3, 6. Queries with OCI_RETURN_LOBS will
| automatically free the DB's Temporary LOBs. Fetches
| returning LOB locators need to use LOB->free(). See
| oci8/tests/bug43497.phpt for examples.
+-----------------------------------------------------------
Previous Comments:
------------------------------------------------------------------------
[2008-01-15 17:30:32] ghosh at q-one dot com
Sorry. I have been on vacation. I will try to check the new patch
this week if possible. Definitely next week otherwise.
------------------------------------------------------------------------
[2008-01-15 02:30:42] sixd@php.net
An enhanced patch was sent to the bug filer and Tony on 8th Jan. I'm
still waiting for feedback . . .
------------------------------------------------------------------------
[2008-01-06 23:17:34] ghosh at q-one dot com
Temporary LOBs are created in UGA memory. This is per-session, so
the leak appears on a per-session basis. Nevertheless this is a
problem, because PHP scripts dont necessarily have to run for a few
seconds. PHP is a full-featured scripting language and can also be
used from the command-line or to implement longer-running
import-scripts. Even if not, the limit is quickly reached, when
reading many rows like in my example.
------------------------------------------------------------------------
[2008-01-06 20:42:52] tony2001@php.net
>What I don't understand: I thought OCI_RETURN_LOBS is just a short-
>cut for those who don't want to write:
That's what I don't understand either: does the leak appear only on
per-session basis or Oracle doesn't free those LOBs at all?
If the leak is only per-session, then users are not supposed even to
notice it, since PHP requests are not supposed to take more than several
seconds.
------------------------------------------------------------------------
[2007-12-29 22:37:21] ghosh at q-one dot com
Really great! Thanks a lot!! This patch works. What I don't understand:
I thought OCI_RETURN_LOBS is just a short-cut for those who don't want
to write:
$s=$result[0]->load();
$result[0]->free();
$result[0]=$s;
If you use OCI_RETURN_LOBS you dont want to care about lobs but get the
result as a string and forget about lobs altogether. So IMHO this should
work as well. My specific problem is solved though.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/43497
--
Edit this bug report at http://bugs.php.net/?id=43497&edit=1