|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50794 memory_get_usage() reports higher in php 5.3
Submitted: 2010-01-18 23:48 UTC Modified: 2010-01-19 00:01 UTC
From: paulsidekick at gmail dot com Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 5.3.1 OS: *nix
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: paulsidekick at gmail dot com
New email:
PHP Version: OS:


 [2010-01-18 23:48 UTC] paulsidekick at gmail dot com
Upgraded to php 5.3 and memory_get_usage reports significantly higher 
for php scripts memory usage both using command line and apache.

To rule out any issues with my code, I removed everything other than the 
call to memory_get_usage();

5.2 consistently reports 70-90k while php 5.3 consistently reports 600-
700k base memory usage for this one line script.  I tried this on mac os 
X and CENT OS/RHEL 5.3, same result.

To make certain it was not something about the way they were compiled I 
downloaded and compiled php 5.2 and 5.3 source from scratch with no 
compile options to make sure I am using the defaults and get the same 
results across several systems.

Reproduce code:
echo memory_get_usage();

Expected result:
70-90k (88232) like PHP 5.2 had.

Actual result:
600-700k (630752) with php 5.3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-19 00:01 UTC]
You can't actually compare memory_get_usage() numbers across 5.2 and 
5.3.  We improved the accuracy of that call in 5.3 as it missed some 
stuff in 5.2.  
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 22 22:01:32 2024 UTC