内存泄漏: 在 10Hz 环更新时,带有 1000 个键的 <text> 在 <scrollbox> 中, Native RssAnon 的大小约为 3 MB/s;JS 堆和节点数量保持不变
作者: codehz创建于 2026年9月11日更新于 2026年9月11日
Environment
- @opentui/core / @opentui/react 0.5.11 (also 0.5.4)
- bun 1.4.2, linux x64
- createTestRenderer (bufferedOutput: "memory")
What
1000 <text> children in a sticky <scrollbox>. Every 100ms drop the oldest row and append a
new one with a monotonic React key.
JS heap plateaus (~+3MB). renderer.root child count stays 1003. /proc/self/status
RssAnon climbs 3 MB/s (+70MB / 15s).
Idle (same 1000 nodes, 10Hz renderOnce, no mutation): RssAnon ~0.
Stable keys (key=slot, only last line text changes): ~9× slower, roughly plateaus.
内容来源: anomalyco/opentui