Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7053915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:33:46+00:00 2026-05-28T03:33:46+00:00

In my project I use my own framework, and sure I use my own

  • 0

In my project I use my own framework, and sure I use my own logging time and memory. Now I found that my memory usage statistics different in different environments. Here I mean two environment: local Windows and production VPS Fedora.

Here is the logger view:

<style>
    div.lt-timer {
        opacity: 0.5; background: #FFF; color: #777; border-radius: 5px; border: 1px solid #CCC;
        font-size: 0.85em; position: fixed; max-width: 300px; max-height: 600px; overflow: auto;
        bottom: 10px; right: 10px; padding: 5px;
    }
    div.lt-timer h4 { text-align: center; font-weight: 700; }
</style>
<div class="lt-timer">
    <h4><?php echo $timer->getName(); ?></h4>
    <?php echo nl2br(implode('', $timer->getPoints())); ?>
    <h4>Total used memory: <?php echo round(memory_get_usage() / 1024, 2); ?> KB</h4>
</div>

Everything is fine, except this line, which gives difference:

<h4>Total used memory: <?php echo round(memory_get_usage() / 1024, 2); ?> KB</h4>

On Windows I’ve got about 598 KB, but for the same request I have 2976 KB on VPS Fedora.

I’ve also have tested for same test.php files containing this:

<?php
    $a = 999;
    $b = 999;
    $c = 999;

    echo memory_get_usage();
?>

And that’s what I got:

Local machine (Windows): 329280
Production machine (Fedora): 633392

Does eAccelerator or xCache could affect this statistics? Or where I’m wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:33:46+00:00Added an answer on May 28, 2026 at 3:33 am

    As of PHP 5.2.x, the memory_get_usage() function has a parameter.

     int memory_get_usage  ([ bool $real_usage = false  ] )
    

    According to php.net, $real_usage is:

    Set this to TRUE to get the real size of memory allocated from system. If not set or FALSE only the memory used by emalloc() is reported.

    Additionally some sources say PHP needs to be loaded as a CGI in Apache to correctly get memory usage by process id using getmypid().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our project we use Zend Framework Model generator, which produces something like this
In our project we use jQuery 1.4.4 and jQuery UI 1.8.7 now. But we
I have an AS3 project making use of compile time constants. This has worked
I am trying to write my own Javascript Framework something like jQuery. I use
I am importing a third party project, which has its own framework. I wish
I am about to start a new project that will use the Play! 2
Hi Ladies and Gentlemen, We've quite big project with own build framework, based mostly
I'm trying to use Greensock LoaderMax on a Starling Framework project, but since Starling
I have a project of mine, written in C++, that has now progressed to
I'm trying to understand a large project that makes heavy use of StructureMap (an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.