• Thomas Jarvis

    (@thomasjarvisdesign)


    On the overview screen Query monitor was suggesting that the php memory limit was set at 256mb which is correct.

    But then next to this it was showing a 40mb limit as the max memory limit for WordPress. I can confirm that the WP Memory limit was not specified in wp-config.

    When I specify the limit in wp-config to 256mb the overview shows the WP memory allocation as 256m matching the php memory limit.

    What I am asking is – Query monitor is suggesting that even with the environment memory set to 256mb that WordPress will only use the default 40mb unless I specify a higher value in wp-config. Is this the case or is this just the way query monitor shows the data when the memory limit is not set in wp-config?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    I’ve noticed this myself on some sites but I must admit I’ve not investigated it. I’ll check and report back.

    Thread Starter Thomas Jarvis

    (@thomasjarvisdesign)

    Thanks John,

    Server environment to help you out:
    I Run the latest version of Plesk on Ubuntu. The site linked to my original post now has the memory limit set in wp-config as 256m.

    I have had some issues with response times for this site that I am trying to iron out. Query monitor was part of my debug so if it is only using 40mb of the allocated 256mb then there is a problem with wordpress and query monitor is correct. However if it is actually using the available 256mb and Query monitor is reporting 40mb then it is a problem with query monitor. I hope this makes sense.

    PHP 8.0 with 256m memory limit set in Plesk.

    If WordPress cannot use more than 40mb of memory unless I specify in wp-config then I’ll have to go through all wp-config files on my server and add the memory limit to them.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Okay so the WP_MEMORY_LIMIT constant (which is the value used for the “WordPress limit” in QM) is a bit of an odd one. By default its value gets set to either a fixed limit based on the context (40M on a regular single site installation) but that value only affects the actual memory limit if the value is greater than the default memory limit on the server.

    From what I can tell, this therefore means it’s only used if the server has a default memory limit lower than 40M.

    The “server limit” section in QM is read from the actual limit in use (the memory_limit value from ini_get()) and is therefore accurate. It looks like I need to revisit why I decided to display the WordPress limit here as it’s misleading when its value is lower than the actual memory limit.

    Thread Starter Thomas Jarvis

    (@thomasjarvisdesign)

    Thanks for the clarification and legwork on the server setup. I had assumed that this was the case as WordPress is detecting a limit of 256 with nothing specified in wp-config.

    I can at least rule out a memory limit in my tests. Thank you for your help.

    I have 83 websites on my servers to date changing wp-Config on all of them would have been a pain!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Clarification on WP Memory Limit’ is closed to new replies.