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

form-render构建的表单,react组件销毁后,发现schema结构、表单元素、相关子节点等未主动销毁,占用内存未回收,长时间使用卡顿 #1498

Open
LOL871230823 opened this issue Mar 14, 2024 · 4 comments
Assignees

Comments

@LOL871230823
Copy link

1.依赖仓库的版本(Dependencies versions)

  • react:17.0.2
  • form-render:2.4.2
  • table-render:
  • antd:4.18.9

2.问题描述(Bug description)
form-render构建的表单,在recat组件中构建使用,发现在react组件销毁后,schema的结构、表单元素、相关子节点等未主动销毁,也并未接触对其的引用,相关节点占用的内存,在组件销毁后,未被垃圾回收机制检测到已解除引用,未回收;已发现有出现内存溢出的现场,长时间使用会造成系统卡顿,甚至无响应;

image

3.出现问题的 schema demo(Reproduction schema demo)

const schema = {
  // ...
}

4.最小复现 demo(Reproduction demo)

form-render demo https://codesandbox.io/s/unruffled-flower-jl78h
table-render demo https://codesandbox.io/s/sweet-euler-bdoty
fr-generator demo https://codesandbox.io/s/s13sh

@LOL871230823 LOL871230823 changed the title form-render构建的表单,react组件销毁后,发现schema结构、表单元素、相关子节点等未主动销毁,并解除引用,占用内存未回收,长时间 form-render构建的表单,react组件销毁后,发现schema结构、表单元素、相关子节点等未主动销毁,占用内存未回收,长时间使用卡顿 Mar 14, 2024
@LOL871230823
Copy link
Author

@lhbxs 大佬是否可以尽快回复一下

@lhbxs
Copy link
Collaborator

lhbxs commented Mar 23, 2024

如果比较急的话,可以尝试提 pr

@LOL871230823
Copy link
Author

你们官方的构造器就可以重现我现在遇到的问题,选择完元素之后,内存上去了,但是删除该元素,内存占用并未释放
image

@LOL871230823
Copy link
Author

@就很奇怪,为啥schema的挂载会重复触发多次呢?不能改成单次?每次设置之前清空下历史值不行嘛?
image

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

2 participants