|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2012-10-29 15:22 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: rrichards
[2012-10-29 21:55 UTC] tstarling@php.net
[2012-12-05 11:08 UTC] rrichards@php.net
-Assigned To: rrichards
+Assigned To: tstarling
[2012-12-05 11:08 UTC] rrichards@php.net
[2012-12-05 11:41 UTC] tstarling@php.net
[2012-12-05 11:49 UTC] pajoye@php.net
[2013-11-08 06:09 UTC] tstarling@php.net
-Status: Assigned
+Status: Open
-Assigned To: tstarling
+Assigned To:
[2013-11-08 06:09 UTC] tstarling@php.net
[2018-03-14 14:28 UTC] cmb@php.net
-Package: XML related
+Package: *XML functions
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 12:00:01 2025 UTC |
Description: ------------ Allocation via libxml does not use PHP's per-request allocator. So any memory used by libxml will not be accounted against memory_get_usage() or memory_limit. At Wikimedia we use libxml DOM trees to store wikitext parse trees, because they are more compact in memory than the equivalent pure-PHP data structures. When these parse trees are cached, the memory requirements can become excessive, and the memory is typically not returned to the system after request termination. Using xmlMemSetup() to set hook functions which use PHP's per-request allocation functions will allow us to more effectively monitor and limit the use of libxml in production. I've developed a patch and will submit it to GitHub as a pull request. Test script: --------------- $doc = new DOMDocument; for ( $i = 0; $i < 1000000 ; $i++ ) { $doc->appendChild($doc->createElement('foo')); } print memory_get_usage()."\n"; Expected result: ---------------- 312331440 (with debug and ZTS) Actual result: -------------- 694256