php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3678 array overhead not good
Submitted: 2000-03-01 05:17 UTC Modified: 2000-03-01 12:25 UTC
From: wico at cnh dot nl Assigned:
Status: Closed Package: Performance problem
PHP Version: 4.0 Latest CVS (01/03/2000) OS: guess every :)
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: wico at cnh dot nl
New email:
PHP Version: OS:

 

 [2000-03-01 05:17 UTC] wico at cnh dot nl
this is what i did:


<?
        for ($x = 0; $x < 500000; $x++) {
                $test[$x] = "";
        }


        echo "DONE<BR>\n"; flush();
        sleep(60);
?>
after running this i found apache useing 65MB of memmory
25520 nobody     0   0 67212  65M  2180 S       0  0.0 26.0   0:04 httpsd


and it doesn't matter if you do this:


$test[$x] = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AA";


it keeps 65MB


I find this strange...

Keep up the good work

Greetz,

Wico

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-01 12:25 UTC] andi at cvs dot php dot net
All arrays in PHP are associative arrays which means that the memory overhead is fairly bigger than a regular array in say, C. In any case, did you compile with --disable-debug? It should make some difference.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC