[Bug]在vue2项目中二次封装该组件进行使用出现内存泄漏情况
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
Version
1.22.7
Link to Minimal Reproduction
现无,但是采用其他表格组件如vex-table未发生此种现象
Steps to Reproduce
1.用vue2项目引入该组件,进行二次封装,用VTable.ListTable创建表格实例,值配置基础的行、数据、容器自适应,销毁方法中有销毁实例的。
2.在其他页面引用该二次封装的组件
3.运行项目打开该页面后,先录制内存快照,页面什么都不操作,等待十几二十分钟后,发现内存一直呈现增加趋势。
附上快照截图以及排查的增加的数据发现是组件内部的方法产出的垃圾:
Current Behavior
使用该组件时内存一直增加,
Expected Behavior
页面引用该组件时内存能正常回收
Environment
- OS:Window10
- Browser:Chrome 96.0.4664.55
- Framework:Vue@2
Any additional comments?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Vue 2 integration that creates a VTable.ListTable and calls its destroy method, then reproduce the report using Chrome memory snapshots. Inspect the suspected internal progress method and compare retained objects before and after leaving the page. Done means the component's memory is reclaimed after destruction during the reported idle period.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100