php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37577 Much Memory Usage while copy big files
Submitted: 2006-05-24 11:45 UTC Modified: 2006-05-24 23:15 UTC
From: petrich at tronic-media dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.4 OS: Linux + Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: petrich at tronic-media dot com
New email:
PHP Version: OS:

 

 [2006-05-24 11:45 UTC] petrich at tronic-media dot com
Description:
------------
Not sure if it's a "bug or a feature",
but when copying a  70MB file via PHP's copy() function,
the php process will use nearly the same Memory.

I found a (closed) Bug Report (#29922) relatet to this Issue (http://bugs.php.net/bug.php?id=29922),
it seems to be fixed long time ago, but in PHP 5.1.4 it is not.

Testet with PHP 5.1.4 (on Win-XP and Linux) as Apache2 Module. (All extentins disabled + default php.ini-dist settings) 

This Bug/Feature does'nt occur in php 4.3.3 (Win-XP as Apache2 Module).


Reproduce code:
---------------
<?php
copy('70MB.data','70MB.data.copy');
/* now look at the (linux) top listing for this Process to trace the growing memmory usage */ 
?>


Expected result:
----------------
Less Memory Usage in the top listing.

Actual result:
--------------
Much Memory Usage in the top listing.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-24 23:15 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

For faster copies php uses mmap() which maps the file to 
memory.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC