Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 同域iframe内存泄漏 #1585

Open
1 task done
BeichenPlus opened this issue Oct 21, 2024 · 1 comment
Open
1 task done

[Bug]: 同域iframe内存泄漏 #1585

BeichenPlus opened this issue Oct 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@BeichenPlus
Copy link

BeichenPlus commented Oct 21, 2024

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

2.0.0-alpha.17

Expected Behavior

同域iframe移出或刷新后释放掉占用的内存

Actual Behavior

当页面内加载同域下的iframe后,iframe刷新或者销毁无法释放内存,多次刷新后OOM。
此问题在跨域Iframe中未曾出现。

Steps to Reproduce

1.创建一个页面,并启动,如地址为:localhost:8080,然后加载同域下其他网页,如:localhost:8080/a.html。
2.页面开启录屏。
3.频繁刷新iframe
4.内存不断膨胀,用chrome devtools分析后发现,元素全部被MutationBuffer类占用,且iframe销毁后,管理Iframe的多个weakMap中的key(iframe.contentWindow)实际未被系统回收,内存泄漏可能与此有关,希望能尽快解决此问题。
如图:我在频繁刷新或删除增加同域iframe时,里面保留了大量iframe实例,实际我页面只有一个Iframe:
image
image

如果我在这里加个 return;则不会出现该问题
image

Testcase Gist URL

No response

Additional Information

No response

@BeichenPlus BeichenPlus added the bug Something isn't working label Oct 21, 2024
@CWTallen
Copy link

CWTallen commented Nov 7, 2024

Same Problem and trouble me for a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants