Revision page render: allowed memory exhausted.
-
I apologice if this message is wrong in any way, this is my first comment in WordPress forum.
In a page having a 33KB content and 17 revisions, when the “Browse” revisions link is clicked the next error message appears:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 268435464 bytes)
in /usr/local/www/global/htdocs/wp/wp-includes/class-wp-text-diff-renderer-table.php on line 419It was confirmed by many logs than there aren’t errors in plugins or similar.
For render a 33KB page revision, a 512MB php.ini memory_limit could be not enought.The problem is next class-wp-text-diff-renderer-table.php code
foreach ( $orig_rows_copy as $orig_row ) { $final_pos = array_search( $orig_matches[ $orig_row ], $final_rows, true ); $orig_pos = (int) array_search( $orig_row, $orig_rows, true ); if ( false === $final_pos ) { // This orig is paired with a blank final. array_splice( $final_rows, $orig_pos, 0, -1 ); } elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows. $diff_array = range( -1, $final_pos - $orig_pos ); array_splice( $final_rows, $orig_pos, 0, $diff_array ); // line 419 } elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows. $diff_array = range( -1, $orig_pos - $final_pos ); array_splice( $orig_rows, $orig_pos, 0, $diff_array ); } }The array_splice is using so much memory than creates an error, and I can’t find how to modify this from functions.php using hooks, filters, or a similar accesible way (changing this core file the problem was solved… but change core files is not a good idea).
My 2 questions:
1- Is there any way of change this from functions.php using hooks or so?.
If not, how about to add to WordPress a way for change this?. A hook, filter or similar.2- Could be modified the revisions render code for use less memory?.
More than 512 MB memory for render a 33KB content revision isn’t too much memory?.
The topic ‘Revision page render: allowed memory exhausted.’ is closed to new replies.