php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80061 Copying large files may have suboptimal performance
Submitted: 2020-09-04 16:29 UTC Modified: 2020-09-21 14:11 UTC
From: [email protected] Assigned: cmb (profile)
Status: Closed Package: Performance problem
PHP Version: 7.4Git-2020-09-04 (Git) OS: *
Private report: No CVE-ID: None
 [2020-09-04 16:29 UTC] [email protected]
Description:
------------
As of PHP 7.4.0, large files are supposed to be copied by mapping
them into virtual memory at once.  That obviously can't work for
files which are larger than any possibly free memory segment.  So
copying files of 1 GiB or 2 GiB is not unlikely to fail for x86
architectures, for instance.  If the memory mapping fails, we fall
back to reading and writing in small chunks, which has suboptimal
performance.

See also <https://github.com/php/php-src/pull/5319#issuecomment-605901029>.



Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-04 16:29 UTC] [email protected]
-Assigned To: +Assigned To: cmb
 [2020-09-04 16:56 UTC] [email protected]
The following pull request has been associated:

Patch Name: Fix mmap copying
On GitHub:  https://github.com/php/php-src/pull/6078
Patch:      https://github.com/php/php-src/pull/6078.patch
 [2020-09-21 14:11 UTC] [email protected]
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Mar 17 10:00:01 2026 UTC