We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
目前 G2 的远程 CI 会出现内存溢出的问题,导致 __tests__/integration/snapshot.spec.ts 不能正常运行测试。
__tests__/integration/snapshot.spec.ts
问题应该是在在切换不同测试图表的时候,canvas.destroy() 并没有销毁上一个图表的图形元素,导致内存一直在增加。定位到问题应该是 G 依赖 antv/util 里面的 memoize,而这个函数用的 Map 去缓存结果,导致这个 Map 一直保存着图形元素的强引用,从而它们不会被垃圾回收。
canvas.destroy()
antv/util
memoize
Map
antv/util 里面的 memoize 使用 WeakMap。
WeakMap
每个人提交的 PR 一定要在本地运行 npm run ci 保证本地没有问题,然后再合并到 v5 分支。
npm run ci
v5
The text was updated successfully, but these errors were encountered:
fix: #4677
Sorry, something went wrong.
xiaoiver
No branches or pull requests
CI 内存溢出
目前 G2 的远程 CI 会出现内存溢出的问题,导致
__tests__/integration/snapshot.spec.ts
不能正常运行测试。问题
问题应该是在在切换不同测试图表的时候,
canvas.destroy()
并没有销毁上一个图表的图形元素,导致内存一直在增加。定位到问题应该是 G 依赖antv/util
里面的memoize
,而这个函数用的Map
去缓存结果,导致这个Map
一直保存着图形元素的强引用,从而它们不会被垃圾回收。解决办法
antv/util
里面的memoize
使用WeakMap
。临时方案
每个人提交的 PR 一定要在本地运行
npm run ci
保证本地没有问题,然后再合并到v5
分支。The text was updated successfully, but these errors were encountered: