Canvas memory leak in Safari
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- frontend, performance
调研方向
Start with the linked rive-memory-leak reproduction and compare the heap snapshots after repeatedly mounting and unmounting @rive-app/react-canvas. Trace the canvas references retained by the React package in Safari; done means repeated remounts no longer leave extra canvas elements accumulating in memory.
由索引模型根据 Issue 内容生成。
描述
Submission checklist
- I have confirmed the issue is present in the latest version of
@rive-app/react-canvasor@rive-app/react-webgl2(or the renderer variant I'm using) - I have searched the documentation and forums and could not find an answer
- I have searched existing issues and this is not a duplicate
Description
We are finding instances in our app of dangling references to canvas elements after rive elements have been unmounted. This is causing a growing memory problem that gets worse over time. It's definitely an issue in safari, possibly an issue in chromium based browsers but more difficult to reproduce.
I've created a repo that makes this reproducible - by mounting and un-mounting the rive component about 100 times I end up with two or three extra canvas elements in the memory snapshot. In our actual app with multiple different animations on various routes, we can sometimes see 10s or 100s of canvas elements accruing over time. With large animations this puts a real strain on memory and performance.
https://github.com/melodicdan/rive-memory-leak
Reproduction steps / code
https://github.com/melodicdan/rive-memory-leak
Atached are two heap snapshots, one with the single mounted canvas element and one after re-mounting ~100 times
Upload your reproduction files / stack trace
heap snapshot 1.json
heap snapshot 2.json
Rive React package version
"@rive-app/react-canvas": "^4.33.0",
Source .riv / .rev file
No response
Screenshots / video
No response
Browser & version
Safari 26.0.1
Operating system & version
macOS 15.7.1
Additional context
No response
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 58
- 平均合并
- 52 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rive-app/rive-react 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 38/100
rive-app/rive-react#410 · 1 条评论 ·
-
Fit.Layout doesn't reflow elements in canvas-lite可能已有人在做 @usero-agent 于 129 天前认领。 未关闭enhancement
难度 4/5 3-5 天 新手友好度 42/100
rive-app/rive-react#409 · 3 条评论 ·
-
Issue: Re-mount RiveComponent multiple times cause web page laggy可能已有人在做 @usero-agent 于 129 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 30/100
rive-app/rive-react#400 ·
-
triage
难度 3/5 1-2 天 新手友好度 45/100
rive-app/rive-react#392 ·
-
triage
难度 1/5 1 小时以内 新手友好度 55/100
rive-app/rive-react#386 · 1 个 reaction ·
查看 rive-app/rive-react 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
QuantumNous/new-api#7839 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
bug p2 triaged
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
test: make the #3408 Claude OAuth token fixture obviously fake so secret scanners stop flagging it未关闭
难度 2/5 1-3 小时 新手友好度 76/100
code-yeongyu/senpi#3436 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 78/100
lingdojo/kana-dojo#32505 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复