分布式应用程序上的 NSZombie
在仍然启用 NSZombie 的情况下编译分发应用程序是否有任何危险?由于它非常有用,我在开发时通常会为我的所有应用程序打开它,但我不了解与启用它并无限期地打开它相关的全部后果和潜在问题。
谢谢!
Is there any danger in compiling an application for distribution with NSZombie still enabled? I generally leave it turned on for all of my apps while developing because of how useful it is, but I don't understand the full ramifications and potential issues related to enabling it and leaving it on indefinitely.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它不是一个编译选项。这是一个环境变量。保留它没有危险,因为它不是您将发布的应用程序包的一部分。
它确实使得查找泄漏变得不可能,因此您可能不想将其保持启用状态。
It's not a compile option. It's an environment variable. There is no danger leaving it on, because it is not part of the application bundle you will release.
It does make it impossible to find leaks, so you might not want to leave it enabled.
如果您保留它,您的应用程序将不会释放所有使用的内存,因此随着时间的推移,您的应用程序将耗尽设备上的所有 RAM 并被操作系统杀死。
如果您实际上并不是在寻找内存泄漏,为什么要保留它呢?
If you leave it on, your application will not release all the memory used, so over time, your application will use up all the RAM on the device and be killed by the OS.
Why would you leave it on if you aren't actually looking for for a memory leak?
绝对地。对于 NSZombie,永远无法释放任何内存。释放的对象只会变成僵尸。最终,当你的僵尸堆变得足够大时,你的应用程序将因内存耗尽而崩溃。
Absolutely. With NSZombie, no memory can be freed, ever. Deallocated objects just turn into zombies. Eventually, after your pile of zombies gets big enough, your app will crash from memory exhaustion.