#44125 [Opn]: Doubled memory usage on XInclude with Unix-style filenames

From: Date: Fri, 15 Feb 2008 00:29:50 +0000
Subject: #44125 [Opn]: Doubled memory usage on XInclude with Unix-style filenames
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122296@lists.php.net to get a copy of this message
ID: 44125 User updated by: ezyang@php.net Reported By: ezyang@php.net Status: Open Bug Type: XML related Operating System: Windows Vista PHP Version: 5.2.5 New Comment: P.S. There is a rather obvious (and effective) workaround for this: realpath($file) before passing it to DOMDocument::load(). However, in theory, such a call should not be necessary. Previous Comments: ------------------------------------------------------------------------ [2008-02-15 00:27:42] ezyang@php.net Description: ------------ On Windows, XML files with large amounts of XIncludes (such as the PHP Documentation Manual, where this bug was discovered) exhibit curious behavior when they were loaded with Unix-style paths: they appear to require double the memory than if they were loaded with Windows-style paths. Reproduce code: --------------- <?php // note forward slashes $file = 'C:/Users/Edward/phpdoc/manual.xml'; $dom = new DOMDocument(); echo "Loading XML\n"; $dom->load($file); echo "Performing XIncludes\n"; $dom->xinclude(); Expected result: ---------------- With an external process manager (Task Manager or Process Explorer), memory usage should spike on $dom->load(), and then stay constant during XIncludes. XIncludes should be very quick. Actual result: -------------- XIncludes take a long time to run, and double the memory usage of php.exe. A curious side-effect of this is that call to $dom->load() immediately after the offending XInclude is extremely slow. This can be from a completely separate process. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44125&edit=1

« previous php.bugs (#122296) next »