[wp-trac] [WordPress Trac] #29341: Raise default value for WP_MEMORY_LIMIT in wp-includes/default-constants.php

WordPress Trac noreply at wordpress.org
Thu Sep 11 18:13:14 UTC 2014


#29341: Raise default value for WP_MEMORY_LIMIT in wp-includes/default-
constants.php
----------------------------+------------------------------
 Reporter:  DavidAnderson   |       Owner:
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Bootstrap/Load  |     Version:  4.0
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+------------------------------

Comment (by nacin):

 I think [https://core.trac.wordpress.org/raw-
 attachment/ticket/28676/20140629-132230-48150535.jpg this photo] is good
 for testing, and I came up with this for logging purposes:

 {{{
 #!php
 <?php
 add_filter( 'wp_image_editors', function() { return
 array('WP_Image_Editor_GD'); });
 function log_mem( $preamble = 'visit' ) {
         $log = array( $preamble );
     $log[] = is_admin() ? 'admin' : 'front';
     $log[] = is_multisite() ? 'single' : 'multi';
     $log[] = get_locale() . "\t";
     $log[] = $mem = memory_get_peak_usage();
     $log[] = size_format( $mem );
     $log[] = ini_get( 'memory_limit' );
     $log[] = phpversion();
     error_log( implode( "\t", $log ) );
 }
 add_action( 'wp_footer', 'log_mem', 10000, 0 );
 add_action( 'admin_footer', 'log_mem', 10000, 0 );
 add_action( 'load-async-upload.php', function() {
         add_action( 'shutdown', function() {
                 log_mem( 'upload' );
         });
 });
 add_action( 'load-update-core.php', function() {
         if ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
                 return;
         }
         add_action( 'shutdown', function() {
                 log_mem( 'upgrade' );
         });
 });
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29341#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list