#21646 closed enhancement (fixed)
Bump memory limit from 32MB
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | trivial | Version: | 3.0 |
Component: | Performance | Keywords: | 2nd-opinion |
Focuses: | Cc: |
Description (last modified by )
On some shared hosts and servers, WordPress runs perilously close to 32MB in the dashboard, especially with a number of plugins included. It's time to bump. I am thinking 40MB as a good, relatively round number.
In the near future (once our minimum PHP version is 5.3, and possibly earlier for those already on 5.3), we can look into autoloading of all of our classes. That should take down our memory a bit. (kurtpayne has looked and it's not much, mainly because so many of them are used on most pages.)
Note that increasing the memory limit does not actually result in 8 more megabytes of memory being used. WordPress won't start eating up that memory — just that PHP allows the script to use up to 40MB. Otherwise, hitting 32 would give a fatal error.
We also should not take this as a license to further increase the side of the WordPress codebase, which has crept up at a pretty steady pace over the years. The only objective is to avoid fatal errors on individual sites.
Change History (10)
#3
@
11 years ago
- Component changed from Performance to Blog by Email
- Keywords close 2nd-opinion added
- Severity changed from normal to trivial
- Type changed from enhancement to feature request
- Version set to 3.4.2
I don't believe this is a Wordpress issue. You need to make a php.ini file and put the following line of code inside of it memory_limit = 40M
#5
@
11 years ago
- Keywords close removed
- Type changed from feature request to enhancement
- Version changed from 3.4.2 to 3.0
99% of blogs that use WordPress have no clue what PHP and memory are, and have no access to php.ini. Because of that, WordPress tries to override memory_limit with an ini_set call, which is currently done using the WP_MEMORY_LIMIT constant at runtime. 32M is 1/4 the default limit PHP recommends in version PHP 5.4.
#6
@
11 years ago
ryansatterfield: WordPress sets a default memory limit for the application in wp_initial_constants().
wonderboymusic: Maybe 48MB? Anything beyond that seems unnecessary even if just from a PR standpoint. (WordPress is bloated, WordPress hogs memory, etc.)
Should multisite change from 64MB, or is that sufficient?
Note that wp_initial_constants() only sets a memory limit if the current memory limit is lower than what we need.
#7
@
11 years ago
48/64 should be fine for 90% of installs - once you get to anything resembling scale, it is really easy to exhaust memory. Just doing modest performance testing with no object cache, things can wipe out quickly. I guess for people who need performance, we should assume they know how to tweak their server(s) and leverage Memcached, etc.
#8
@
11 years ago
I apologize for the mistake. Shouldn't Wordpress 5.0 be less bloated since it is changing to PDO? Could 48/64 be considered a temporary fix?
PHP 5.4's default dev and prod .ini files have
memory_limit = 128M
.Since the purpose of
WP_MEMORY_LIMIT
is toini_set
, I don't think we have to be so modest. I'm not sure what the default is for 5.2.6, but it was8M
before PHP 5.2.0 and16M
in PHP 5.2.0.Also, since PHP 5.2.1,
--enable-memory-limit
no longer has to be set at compile time to be able toini_set
the values.