CLOB memory leak

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kabbalah
Forum Newbie
Posts: 3
Joined: Mon Jan 03, 2005 1:32 am
Location: Bulgaria

CLOB memory leak

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

any error messages or log entries that can help shed some light?
kabbalah
Forum Newbie
Posts: 3
Joined: Mon Jan 03, 2005 1:32 am
Location: Bulgaria

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sounds like it hung... so I'd guess an infinite loop or similar... :?
kabbalah
Forum Newbie
Posts: 3
Joined: Mon Jan 03, 2005 1:32 am
Location: Bulgaria

Post 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 ?
Post Reply