php.net |  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
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: paulsidekick at gmail dot com
New email:
PHP Version: OS:

 

 [2010-01-18 23:48 UTC] paulsidekick at gmail dot com
Description:
------------
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:
---------------
<?php
echo memory_get_usage();
?>

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

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-19 00:01 UTC] rasmus@php.net
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: Sun Dec 22 11:01:30 2024 UTC