[wp-trac] [WordPress Trac] #14889: Memory Comparison Broken / WordPress Memory Limit
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 17 11:45:16 UTC 2010
#14889: Memory Comparison Broken / WordPress Memory Limit
--------------------------+-------------------------------------------------
Reporter: hakre | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords: has-patch
--------------------------+-------------------------------------------------
WordPress falsely assume that PHP memory limit values can be normalized as
an integer value and then compared to each other:
{{{
// set memory limits.
if ( function_exists('memory_get_usage') && ( (int)
@ini_get('memory_limit') < abs(intval(WP_MEMORY_LIMIT)) ) )
@ini_set('memory_limit', WP_MEMORY_LIMIT);
}}}
/wp-includes/default-constants.php line 37
With a memory-limit setting of one gigabyte ('1G') to give an example,
wordpress will reduce this to 32 Megabyte (Single Site) or 64 Megabyte
(Multisite).
PHP Memory Values are often used with the shorthand notation
[http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes as
documented].
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14889>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list