[Bug] GPU 显存崩溃
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.7k
- Forks
- 486
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Description
Version
V1.22.0
Link to Minimal Reproduction
官网即可实现
Steps to Reproduce
在官网上用同一个标签下的不同demo切换
然后GPU一直上涨(在浏览器中shift + Esc查看GPU)
停止不动一段时间后也还是不明显下降
然后点击【贡献指南】这个tab下的内容,之前的GPU占用也依旧存在
Current Behavior
GPU显存未释放
Expected Behavior
GPU显存随页面的离开而主动清理
Environment
- OS:win11
- Browser:chrome 143.0.7499.170(正式版本) (64 位)
- Framework:vue@3
Any additional comments?
最开始是在1.22.0[+] Version(中级性能核显4G的主机)上也发现有进程突然卡住问题,然后表格没有正常显示而是展示成下图然后突然重新绘制:[/+][-] Version上也发现有进程突然卡住问题,然后表格没有正常显示而是展示成下图然后突然重新绘制:[/-]
然后gemini这边分析可能是GPU进程崩溃重启
现在我用一种方式解决了这个问题,但是这应该是官方在release方法中可以处理的。
// 在onBeforeUnmount / onDeactivated 生命周期中清理内在的canvas
function clearCanvasCache() {
const canvas = vtableContain.value?.querySelector('canvas');
if (canvas) {
console.log('清理Canvas缓存');
canvas.width = 0;
canvas.height = 0;
}
}
希望这个方案能帮到其他人和我发生同样问题的人
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 by reproducing the GPU-memory growth on the official site while switching demos and tabs in Chrome. Trace the Vue component and canvas container referenced by vtableContain, along with onBeforeUnmount and onDeactivated; done means GPU memory is released or drops clearly after leaving the page and switching to the contribution guide.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100