[wp-trac] [WordPress Trac] #14889: Memory Comparison Broken / WordPress Memory Limit

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 25 12:05:12 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:  3.0            
 Severity:  normal        |    Keywords:  has-patch      
--------------------------+-------------------------------------------------

Comment(by dd32):

 For the purposes of memory calculation, i don't think converting to
 kilobytes / taking into account a kilobyte value is a required process.

 An anonymous function such as that seems overkill as well.

 {{{
 $in = '1G';
 $gigabytes = ('g' == strtolower( substr($in, -1) ) );
 $out = (int)$in;
 if ( $gigabytes )
   $out *= 1024;

 echo $out; //in MB
 }}}

 To make our life simpler, we can also require that WP_MEMORY_LIMIT be
 specified in M, This'll reduce the ammount of operations required on each
 page load.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14889#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list