[wp-trac] [WordPress Trac] #63588: do_blocks(): Free up transient memory leak

WordPress Trac noreply at wordpress.org
Tue Jul 8 09:00:19 UTC 2025


#63588: do_blocks(): Free up transient memory leak
------------------------------------------------+--------------------------
 Reporter:  dmsnell                             |       Owner:  dmsnell
     Type:  enhancement                         |      Status:  closed
 Priority:  normal                              |   Milestone:  6.8.2
Component:  Editor                              |     Version:  trunk
 Severity:  normal                              |  Resolution:  fixed
 Keywords:  has-patch dev-reviewed fixed-major  |     Focuses:  performance
------------------------------------------------+--------------------------
Changes (by audrasjb):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60435" 60435]:
 {{{
 #!CommitTicketReference repository="" revision="60435"
 Editor: Free up transient memory leak in `do_blocks()`.

 There has been a memory inefficiency inside of `do_blocks()` where it
 parses the given content then iterates through each top-level block to
 render it. Unfortunately each top-level block can considerably add to
 the overall memory use involved, and once moving on to the next
 top-level block, all of the allocated memory will be retained until the
 end of the call to `do_blocks()`.

 In this change, each parsed block sub-tree is freed via reset to null
 after it has been rendered. All top-level blocks are rendered
 independently of each other and so this operation is safe — there are no
 data dependencies between them.

 This commit also includes follow-up changes committed in [60400] and
 [60402].

 Rewieved by audrasjb.
 Merges [60316], [60400] and [60402] to the 6.8 branch.
 Props dmsnell, joemcgill.
 Fixes #63588.
 }}}

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


More information about the wp-trac mailing list