Title: Memory usage wrong when not using M
Last modified: December 14, 2016

---

# Memory usage wrong when not using M

 *  [kmthompkins](https://wordpress.org/support/users/kmthompkins/)
 * (@kmthompkins)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/memory-usage-wrong-when-not-using-m/)
 * 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](https://wordpress.org/support/users/apasionados/)
 * (@apasionados)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/memory-usage-wrong-when-not-using-m/#post-8552441)
 * 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](https://wordpress.org/support/users/kmthompkins/)
 * (@kmthompkins)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/memory-usage-wrong-when-not-using-m/#post-8552563)
 * 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](https://wordpress.org/support/users/apasionados/)
 * (@apasionados)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/memory-usage-wrong-when-not-using-m/#post-8552990)
 * 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](https://wordpress.org/support/users/kmthompkins/)
 * (@kmthompkins)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/memory-usage-wrong-when-not-using-m/#post-8553071)
 * 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 9 years, 5 months ago by [kmthompkins](https://wordpress.org/support/users/kmthompkins/).
 *  Plugin Author [apasionados](https://wordpress.org/support/users/apasionados/)
 * (@apasionados)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/memory-usage-wrong-when-not-using-m/#post-8553340)
 * 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.

 * ![](https://ps.w.org/server-ip-memory-usage/assets/icon-128x128.png?rev=982864)
 * [Server IP & Memory Usage Display](https://wordpress.org/plugins/server-ip-memory-usage/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/server-ip-memory-usage/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/server-ip-memory-usage/)
 * [Active Topics](https://wordpress.org/support/plugin/server-ip-memory-usage/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/server-ip-memory-usage/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/server-ip-memory-usage/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [apasionados](https://wordpress.org/support/users/apasionados/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/memory-usage-wrong-when-not-using-m/#post-8553340)
 * Status: not resolved