php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47908 problem with error error: Allowed memory size of 134217728 bytes exhausted
Submitted: 2009-04-06 13:23 UTC Modified: 2010-01-20 19:18 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: kiet dot tran at enscm dot fr Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5.2.9 OS: linux Redhat ES 4.7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kiet dot tran at enscm dot fr
New email:
PHP Version: OS:

 

 [2009-04-06 13:23 UTC] kiet dot tran at enscm dot fr
Description:
------------
I have this function which runs well on Php 4.9 :

function lire_structure($inlist_stru,$link) {
	if ($inlist_stru=='') return '';
	$stmt = OCIParse($link,"select STRU_ID,STRU_MOLFILE from sub_structure_view where stru_id in(".$inlist_stru.")");
	OCIExecute($stmt);
	while (OCIFetchInto ($stmt, $row, OCI_RETURN_LOBS)) {
		$i++;
		$tabstru[$row[0]]=$row[1];
		//echo "$i<br>";
	}
	return $tabstru;
}


But when I used it on php 5.2.9 :

I have this following error :
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 524288 bytes)

So I change the memory limit of php.ini from 128 M to 512 (256 m is not enough) and the function works well.
But I'm asking why with php 4.9 where the memory limit of php.ini is only at 8 M, the function works well?

I see in internet forum that php 5 releases memory no correctly.
Could you help me?

Actual result:
--------------
I have this following error :
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 524288 bytes)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-07 20:33 UTC] sixd@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

----------------

Your observation is likely due to PHP 5 tracking memory better. The migration doc http://www.php.net/manual/cs/migration52.other.php says 'Thanks to this new-found accuracy memory usage may appear to have increased, although actually it has not.'  

Or perhaps the new memory manager chunking and other changes to OCI8 plays a role. Calculate how much data you need to hold after fetching to see what expectation you should have.

With large data sizes, fetching LOBs as locators (i.e. remove OCI_RETURN_LOBS) and operating on them one by one might reduce peak memory, depending on your output requirements.


 [2010-01-20 19:18 UTC] sixd@php.net
Also see http://bugs.php.net/bug.php?id=50789
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 13:01:27 2024 UTC