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

start 函数配置 destory true,切换子应用,内存持续增加 #6

Open
psybor opened this issue May 19, 2022 · 0 comments
Open

Comments

@psybor
Copy link

psybor commented May 19, 2022

问题表现:
配置 destory: true 后,连续切换子应用,内存持续增加。
重现步骤:
测试1:任务管理器

  1. 在 main_apps/react16/src/index.js 配置 start 函数,增加 destroy: true, 配置。
  2. yarn dev:main-react16
  3. 访问首页,不打开控制台,打开浏览器任务管理器。
  4. 连续切换 vue2, vue3, vue-vite, nextjs11, nuxtjs2 5个子应用,循环8次,每次循环结束后等待15s GC,然后查看内存。
    image

测试2:控制台内存查看

  1. 打开控制台的内存 tab,点击收集垃圾,选择时间线配置
  2. 记录,连续切换 vue2, vue3, vue-vite, nextjs11, nuxtjs2 5个子应用,循环4次。
  3. 点击收集垃圾,然后停止记录
    image

测试3: 配置 destory: false

  1. 在 main_apps/react16/src/index.js 配置 start 函数,增加 destroy: false, 配置。
  2. 打开控制台的内存 tab,点击收集垃圾,选择时间线配置
  3. 记录,连续切换 vue2, vue3, vue-vite, nextjs11, nuxtjs2 5个子应用,循环4次。
  4. 点击收集垃圾,然后停止记录
    image

另外,在 destory: true模式下,第二次进入 react16, react 17 子应用报错,这又是另外的问题了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant