|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #174 httpd process with PHP3 compiled in grow in size to approx. 100MB (wastefully)
Submitted: 1998-03-14 21:17 UTC Modified: 1998-03-17 22:56 UTC
From: short at k332 dot feld dot cvut dot cz Assigned:
Status: Closed Package: Performance problem
PHP Version: 3.0 Latest CVS OS: Linux: RedHat-5.0/Kernel-2.1.88
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: short at k332 dot feld dot cvut dot cz
New email:
PHP Version: OS:


 [1998-03-14 21:17 UTC] short at k332 dot feld dot cvut dot cz
During several hash manipulations (e.g. mainly copy) the current PHP code approx. doubles the has table size during EACH copy. Such httpd becomes quickly unusable as the size grows to 100MB (in my case) and it starts swapping. Solution (=bugfix IMHO) is simple:
--- php-cvs/hash.c-orig Sun Mar 15 09:50:43 1998
+++ php-cvs/hash.c      Sun Mar 15 09:51:23 1998
@@ -64,7 +64,7 @@
        uint i;

        for (i = 0; i < nNumPrimeNumbers; i++) {
-               if (nSize < PrimeNumbers[i]) {
+               if (nSize <= PrimeNumbers[i]) {
                        nSize = PrimeNumbers[i];
                        ht->nHashSizeIndex = i;
Thanks for source-available excellent language!


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1998-03-17 22:56 UTC] ars
Fixed by andi
diffs at
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 14 07:01:23 2021 UTC