Add comprehensive memory analysis tool with guide and test script

Co-authored-by: jxxghp <jxxghp@163.com>
This commit is contained in:
Cursor Agent
2025-07-09 08:04:10 +00:00
parent d17e85217b
commit 3efbd47ffd
3 changed files with 400 additions and 3 deletions

View File

@@ -289,9 +289,6 @@ class MemoryHelper(metaclass=Singleton):
# 获取内存分配统计
try:
stats = tracemalloc.get_traced_memory()
f.write(f"内存分配统计: {stats}\n")
# 获取前10个内存分配最多的位置
snapshot = tracemalloc.take_snapshot()
top_stats = snapshot.statistics('lineno')