任何人都知道为什么leaks
不保存堆栈回溯。
我正在运行以下代码:
$ MallocStackLoggingNoCompact=1 leaks 2764 -fullContent --outputGraph=chanita
但是我得到以下输出:
leaks(3032,0x10ff275c0) malloc: stack logs being written into /tmp/stack-logs.3032.109a88000.leaks.wyh5BI.index
leaks(3032,0x10ff275c0) malloc: recording malloc and VM allocation stacks to disk using standard recorder
leaks(3032,0x10ff275c0) malloc: stack logging compaction turned off; size of log files on disk can increase rapidly
leaks(3033,0x10afe65c0) malloc: stack logs being written into /tmp/stack-logs.3033.106548000.leaks.9JZ1V3.index
leaks(3033,0x10afe65c0) malloc: recording malloc and VM allocation stacks to disk using standard recorder
leaks(3033,0x10afe65c0) malloc: stack logging compaction turned off; size of log files on disk can increase rapidly
Invalid connection: com.apple.coresymbolicationd
Output graph successfully written to 'chanita.memgraph' [0.44 MB]
leaks(3033,0x10afe65c0) malloc: stack logs deleted from /tmp/stack-logs.3033.106548000.leaks.9JZ1V3.index
leaks(3032,0x700009052000) malloc: stack logs deleted from /tmp/stack-logs.3032.109a88000.leaks.wyh5BI.index
进程2764是在模拟器上运行的应用程序(如果有区别的话)。
Xcode能够生成堆栈回溯,所以看起来很奇怪。我想使用命令行工具leaks
来生成它,而不是Xcode。
答案 0 :(得分:0)
我自己回答,也许对其他人也有帮助。
问题是我需要使用环境变量MallocStackLoggingNoCompact=1
而不是leaks
命令运行要检查泄漏的应用程序。
一旦我完成了,内存图将包含回溯。