Make WordPress Core

Opened 3 years ago

Last modified 5 months ago

#54117 new enhancement

Changing memory limit descriptions

Reported by: fyremoon's profile fyremoon Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 5.8.1
Component: Bootstrap/Load Keywords: needs-patch
Focuses: docs Cc:



A couple of things that stand out, WP_MAX_MEMORY_LIMIT is for the admin side of the site and WP_MEMORY_LIMIT is for the visitor side. If these were updated in the next version to more friendly names like WP_VISITOR_MEMORY_LIMIT and WP_ADMIN_MEMORY_LIMIT, it would be easier to set up these limits.

How is the memory limit decided for WordPress? I've overridden the defaults since my server has 1GB max memory for PHP, so I've set them to 512 and 1024 respectively but is there a reason why the memory limits are set to arbitrary figures and not a percentage of the limit?

Change History (2)

#1 @Clorith
2 years ago

  • Component changed from Site Health to General

#2 @desrosj
5 months ago

  • Component changed from General to Bootstrap/Load
  • Focuses docs added
  • Keywords needs-patch added

Thanks for this, @fyremoon, and welcome to Trac! Apologies that it took so long to receive a response.

I'll start by saying the likelihood that the names of these constants are changed is almost 0. This is because of the very high amount of usage within plugins. These two links also only show plugins referencing these constants. It's impossible to know how many people are assigning a custom value to these within wp-config.php files or by other means.

That said, I think there are some opportunities to provide better inline documentation around how memory limits are set, and how they can be altered or controlled. On first look, it seems that wp_raise_memory_limit() and the filters within that function have some good details. However, where the constants are initially assigned value there is no documentation.

Note: See TracTickets for help on using tickets.