Files
Chan/docs/IDEA/IDEA-002-memory-leak-and-chan-tv.md
T
jackyu66gitandCursor df27b4dde8 refactor: ECR-002 拆分 runtime 包并加深 analyze 契约(已审)
将 web/services/runtime.py 拆为 runtime/ 子模块并保持门面兼容;补齐 ESS 文档、门面/契约/TF_DF 测试与 CODE_REVIEW Approve。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 18:15:23 +08:00

36 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Idea: 主站自动刷新内存泄漏 + chan_tv 体验修补
## Problem
主站(Lightweight Charts)勾选自动刷新后,浏览器内存持续上涨;首屏偶发重复打 `/api/analyze`。全版 TradingView`/chan_tv`)指标/布局/未完成中枢体验不完整。
## Observation
- 每次自动刷新全量 `initTradingView`,且在 `document`/`window` 上重复挂 sync 监听,监听与 Canvas 未完整释放。
- `ui.js` 加密货币首屏对 `updateChart()` 调度了两次。
- `get_klc_list``TF_DF` / `analyze_chan` 可能重复跑 ChanMACD。
- `chan_tv` 需 WS 与 REST 可分离、指标本地恢复、未完成中枢绘制修正。
## Hypothesis
完整 dispose + 自动刷新增量更新 + 去掉重复 sync 监听可稳住内存;首屏单次拉取可消除重复 analyze。chan_tv 问题为前端/datafeed 修补,不改缠论算法语义。
## Expected Impact
自动刷新可长期开启;首屏请求减半;chan_tv 更接近可用交易终端体验。
## Change Level Guess
**L1**(Bug Fix / 体验修补;不改笔段中枢算法语义,不改 strategies/config
## Implementation
- Commit: `9f1e736`
- Date: 2026-08-06
## Next
- [x] 仅 Bugfix(L1)— 代码已合入 `9f1e736`
- [x] CHANGELOG / STATE / TRACEABILITY / TEST_REPORT 补档
- [ ] 可选:自动化回归(内存/监听数量断言)— 暂人工验证