Page 1 of 1

CLOB memory leak

Posted: Mon Jan 03, 2005 1:41 am
by kabbalah
hi there
I'm using Oracle CLOB in order to store some pretty large string but when I retrieve it back several times the web server crashes. I free all my objects the code is small and looks fine for me but it looks like there's some nasty memory leak that I can't spot. I'm using PHP 5 with Apache 1.3 and OCI functions. Here is the code:

Code: Select all

$conn = oci_connect("SERVICE_DEV", "SERVICE", "ORCL");
$query = "SELECT HTML FROM WC_ARCHIVE_WARRANTY_CARD WHERE ID = '{$_GET['id']}'";
$stmt = oci_parse($conn, $query);
oci_execute($stmt);
while (OCIFetchInto($stmt, $arr, OCI_ASSOC)) {
	$html = ($arr['HTML']->load());	
}
echo $html;
unset($html);
unset($arr);
oci_free_statement($stmt);
oci_close($conn);
10x in advance :)


feyd | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Mon Jan 03, 2005 3:58 am
by feyd
any error messages or log entries that can help shed some light?

Posted: Mon Jan 03, 2005 4:19 am
by kabbalah
well it's strange but I don't get any error messages. After several executions of the above script, the web server justs stops responding and I have to kill it with net stop apache.
The only message I get is
[Fri Dec 31 11:26:42 2004] [error] forcing termination of child #0 (handle 324)
I'm really stuck and this is very important, so if anyone could give me any help with this I'll be very grateful

Posted: Mon Jan 03, 2005 4:38 am
by feyd
sounds like it hung... so I'd guess an infinite loop or similar... :?

Posted: Mon Jan 03, 2005 5:47 am
by kabbalah
well I rewrote the code in order to find where the error comes from it now looks like this

Code: Select all

<?php
$conn = oci_connect("SERVICE_DEV", "SERVICE", "ORCL");
$query = "SELECT HTML FROM WC_ARCHIVE_WARRANTY_CARD WHERE ID = '{$_GET['id']}'";
$stmt = oci_parse($conn, $query);
oci_execute($stmt);
$html = "dsfsdfsdfsdfsdf";    

echo $html;
unset($html);
unset($arr);
oci_free_statement($stmt);
oci_close($conn);
?>
and it still hangs.... any ideas ?