|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37996 Memory Allocation Failed
Submitted: 2006-07-03 12:27 UTC Modified: 2006-07-03 14:07 UTC
From: GastonRobledo at gmail dot com Assigned:
Status: Not a bug Package: *XML functions
PHP Version: 5.1.4 OS: XP, Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: GastonRobledo at gmail dot com
New email:
PHP Version: OS:


 [2006-07-03 12:27 UTC] GastonRobledo at gmail dot com
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));
		xml_parse_into_struct($xml_parser, $contents, $arr_vals);

		$this->arr_xml = $arr_vals;


Expected result:

Actual result:
Memory allocation failed : growing buffer..


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-03 12:51 UTC]
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 14:07 UTC]
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 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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 20:01:31 2024 UTC