• The memory usage is not calculated correctly when using something other than G as the setting:

    $ php -i | grep memory
    memory_limit => 2G => 2G <– confirmed in phpinfo() as well, as well as modifying the footer to echo it out

    Footer:
    Memory: 56.15 of 2 MB (2808%)

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author apasionados

    (@apasionados)

    Hi there,

    For us it’s working correctly on the websites with 1GB of memory or more.

    How would you change it so that it also works for you?

    Best regards from Spain.

    Thread Starter kmthompkins

    (@kmthompkins)

    I’d suggest parsing the memory_limit to see if it contains M or G. If it’s G, then return the value multiplied by 1024.

    Plugin Author apasionados

    (@apasionados)

    Hi there,

    We use ini_get('memory_limit') to get the memory limit which on all the servers we have used for testing returns the value in MB and not in GB.

    For example: Memory: 40.9 of 1028 MB (4%)

    That’s why we have never had your problem.

    In order to change the coding we would like to reproduce the problem. What OS and PHP version are you running?

    Best regards from Spain.

    Thread Starter kmthompkins

    (@kmthompkins)

    The server is CentOS 6.8 with PHP 5.4.45.

    # php -r 'echo ini_get("memory_limit")."\n";'
    2G

    This works the same with Ubuntu 14.04 and PHP 5.6.23

    # php -r 'echo ini_get("memory_limit")."\n";'
    1G
    • This reply was modified 7 years, 11 months ago by kmthompkins.
    Plugin Author apasionados

    (@apasionados)

    Hi there,

    On our CentOS 6.8, CentOS 7 and Ubuntu 14.04 with PHP 7.0.x we get the memory limit always in MB and not in GB.

    We are no system administrators and therefore will have to search for somebody to reproduce this case and solve it.

    This will take some time.

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Memory usage wrong when not using M’ is closed to new replies.