Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Canvas memory leak in Safari

已关闭
#440 6 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
react, typescript

调研方向

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-canvas or @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

Image Image
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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rive-app/rive-react 的其他 Issue

查看 rive-app/rive-react 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。