#37996 [Fbk->Bgs]: Memory Allocation Failed
| From: | rrichards@php.net | Date: | Mon, 03 Jul 2006 14:07:39 +0000 |
| Subject: | #37996 [Fbk->Bgs]: Memory Allocation Failed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99070@lists.php.net to get a copy of this message | ||
ID: 37996
Updated by: rrichards@php.net
Reported By: GastonRobledo at gmail dot com
-Status: Feedback
+Status: Bogus
Bug Type: *XML functions
Operating System: XP, Linux
PHP Version: 5.1.4
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
You are running out of system memory. error issued from libxml.
With this amount of data, this is a really good reason why you should
stream the input rather than try to load it all at once and not create
in memory trees/structures of it.
Previous Comments:
------------------------------------------------------------------------
[2006-07-03 12:51:25] tony2001@php.net
Please provide full error messages and not just parts of them.
Apparently I can't reproduce it without your 350Mb XML file and there
is no such error message in PHP, so.. where exactly it comes from?
Which line, function etc.?
------------------------------------------------------------------------
[2006-07-03 12:27:51] GastonRobledo at gmail dot com
Description:
------------
Hi, i recive this message when i try to parse the xml file.
Memory allocation failed : growing buffer..
The filesize of the XML is 365.852 KB; 350 MB.
in the PHP.ini the memory_limit = 450 M.
but i always recive the message.
Reproduce code:
---------------
this is the code:
function xml2php($file) {
$xml_parser = xml_parser_create();
if (!$fp = fopen($file, "r")) {
die("unable to open XML");
}
$contents = fread($fp, filesize($file));
fclose($fp);
xml_parse_into_struct($xml_parser, $contents, $arr_vals);
xml_parser_free($xml_parser);
$this->arr_xml = $arr_vals;
}
Expected result:
----------------
Nothing...
Actual result:
--------------
Memory allocation failed : growing buffer..
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37996&edit=1