|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
27 - 10 = ?
Subscribe to this entry?

 [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-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 14 05:01:22 2021 UTC