Memory leaks in Iframe
and BlockPreview
#53382
Labels
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
[Type] Performance
Related to performance efforts
Description
While playing with ideas of potentially improving the performance of
<BlockPreview>
, I discovered that the<Iframe>
component from theblock-editor
package is leaking memory.This is especially noticeable when loading lots of patterns, which render
<BlockPreview>
s and<Iframe>
s under the hood. Memory leaks can cause the page to feel heavy and unresponsive, then eventually stop working when it reaches the browser's limits. This is also worse in Site Editor where we rely on client side navigation and never give the browser chance to nuke everything.I have some leads regarding identifying the code that causes the leaks, but none are proven yet. I can continue to find them if given more time, but decided to open an issue first for awareness.
Step-by-step reproduction instructions
<BlockPreview>
-><Iframe>
).<BlockPreview>
and<Iframe>
)Screenshots, screen recording, code snippet
Using the "Performance Monitor" tab:
Kapture.2023-08-07.at.14.50.24.mp4
Using the "Memory" tab record the heap snapshots:
Kapture.2023-08-07.at.15.02.21.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: