4

I have created an iOS app and need to check the leaks in the app programmatically. (Hence not using instruments directly)

For the above I use the leaks command as follows:

MallocStackLogging=1 leaks -nocontext

At one point of time this was working properly without issues. But recently I have started getting errors and the leaks commands gives different number of leaks each time.

Has anyone faced a similar issue?

4

1 回答 1

0

您可以使用 vm_statics 对象以编程方式查找当前内存统计信息。通过这些链接找到 vm_statistics 的实现:

1)

http://gamesfromwithin.com/whered-that-memory-go

2)

http://landonf.bikemonkey.org/code/iphone/Determining_Available_Memory.20081203.html

于 2012-12-25T07:28:30.717 回答