[wp-trac] [WordPress Trac] #24958: Large number of revisions cause memory exhaustion

WordPress Trac noreply at wordpress.org
Tue Nov 3 05:20:19 UTC 2015


#24958: Large number of revisions cause memory exhaustion
------------------------------------+-----------------------------
 Reporter:  jshreve                 |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  low                     |   Milestone:  Future Release
Component:  Revisions               |     Version:  3.6
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+-----------------------------

Comment (by pdfernhout):

 Issue #34560 overlaps this one, but is not the same. The difference is the
 other issue is about server errors resulting from using the edit screen on
 a large post with many revisions, whereas this issue is about failures
 resulting in other components from that situation. That other issue also
 lists use cases for having many edits of a long page.

 For both issues, the failures seem to result from using
 wp_get_post_revisions to get all revision data including content instead
 of using more selective SQL that just retrieves the needed metadata (or
 possibly just the count of revisions for the editor). While all systems
 have their limits, using wp_get_post_revisions as-is makes WordPress hit
 limits much sooner than otherwise would happen.

 Such use of wp_get_post_revisions as-is also slows responsiveness due to
 unneeded copying of post content which can be substantial sometimes. For
 example, even if you have enough memory, if you have 100 revisions of a
 page that are 100K each, WordPress would retrieve 10MB from the database
 to return perhaps 10K or so of metadata to the user for a list of
 revisions (or only just a few bytes of metadata in the case of the editor
 which needs just the total number of revisions). The more revisions and
 the bigger they are, the worse the unnecessary performance hit is.

 It is possible there may be common functionality that could be created to
 improve both issues, such as an extra option to wp_get_post_revisions to
 just retrieve post metadata (so, not including post content).

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


More information about the wp-trac mailing list