发现僵尸Find Zombies

僵尸仿形模板使用拨款的仪器来测量你的应用一般的内存使用情况,对检测overreleased“僵尸”的对象,是一个焦点,是在他们已经被释放,不再存在所谓的对象。The Zombies profiling template uses the Allocations instrument to measure general memory usage in your app, with a focus on the detection of overreleased “zombie” objects—that is, objects that are called after they’ve been released and no longer exist.

在这个模板,配置工具配置为使nszombie检测。这是一个调试模式,设置环境变量nszombieenabled真实,指导编译器替代任何对象被释放到零再也没有那些对象的引用计数型NSZombie对象应该存在。如果一个消息然后发送到一个释放的对象(这是现在nszombie对象),僵尸的标记,应用程序崩溃,记录停止,和僵尸消息对话框。然后,您可以检查僵尸对象的保留和释放历史,以确定问题发生的确切位置。In this template, the Allocations instrument is configured to enable NSZombie detection. This is a debug mode that sets the environment variable NSZombieEnabled to true, directing the compiler to substitute an object of type NSZombie for any objects that are released to a reference count of zero—no more of those objects should exist. If a message is then sent to one of these deallocated objects (which are now NSZombie objects), the zombie is flagged, the app crashes, recording stops, and a Zombie Messaged dialog appears. You can then examine the retain and release history of the zombie object to determine exactly where the problem occurred.

IMPORTANT

僵尸模板造成持久性存储器增长因为它改变你的环境,对象不会被释放释放技术。这是预期的行为,但它意味着除了僵尸标志和内存地址历史之外,分配工具提供的任何其他统计数据都应该被忽略。你也不应该在僵尸模板中添加泄漏工具,因为它会产生不准确的结果。对于iOS应用程序,使用僵尸模板与iOS模拟器,而不是物理设备。The Zombies template causes persistent memory growth because it changes your environment so that deallocated objects are never technically deallocated. This is expected behavior, but it means that aside from zombie flags and memory address histories, any other statistics provided by the Allocations instrument should be ignored. You also shouldn’t add the Leaks instrument to the Zombies template, as it will produce inaccurate results. For iOS apps, use the Zombies template with the iOS Simulator, rather than a physical device.

在你的应用程序中寻找僵尸To look for zombies in your app
  1. 运载工具。Launch Instruments.

  2. 在出现的分析模板选择对话框中,单击“僵尸”。In the profiling template selection dialog that appears, click Zombies.

  3. 从目标设备和流程列表中选择您的设备和应用程序。Choose your device and app from the target device and process lists.

  4. 单击“选择”创建跟踪文档。Click Choose to create a trace document.

  5. 单击“记录”按钮在工具栏(或按command-r)开始记录。Click the Record button () in the toolbar (or press Command-R) to begin recording.

  6. 正常使用你的应用程序。Use your app normally.

    如果调用了一个函数对象,国旗插在时间轴面板和僵尸的消息对话框,提示信息是在一个特定的内存地址发送一个释放对象。If a call is made to a deallocated object, a flag is inserted in the timeline pane and a Zombie Messaged dialog appears, indicating that a message was sent to a deallocated object at a specific memory address.

    如果你关闭僵尸消息对话框,你可以打开它点击旗帜。If you close the Zombie Messaged dialog, you can reopen it by clicking the flag.

  7. 点击箭头旁边的僵尸的内存地址显示在详细信息窗格中的僵尸对象的历史记忆,以及相应的引用计数和方法调用。Click the focus arrow () next to the zombie’s memory address to display the memory history of the zombie object in the detail pane, along with corresponding reference counts and method calls.

  8. 在详细窗格中选择僵尸事件(或任何其他要调查的事件)。Select the Zombie event (or any other event you want to investigate) in the detail pane.

  9. 记者command-3显示在检查员的扩展的详细地区选定的事件堆栈跟踪。Press Command-3 to display a stack trace for the selected event in the extended detail area of the inspector.

  10. 单击折叠按钮在扩展的详细地区隐藏在堆栈跟踪的系统调用。这样可以更容易地找到应用程序的方法。Click the Collapse button () in the extended detail area to hide system calls in the stack trace. This makes it easier to locate your app’s methods.

    在你的应用程序进行调用的都是黑色的,之前有一个用户代码图标。Calls made by your app are colored black and preceded by a user code icon ().

  11. 双击堆栈跟踪中的一个方法,以在工具中显示其代码。Double-click a method in the stack trace to display its code in Instruments.

  12. 点击Xcode按钮在细节窗格顶部在Xcode打开代码编辑。Click the Xcode button () at the top of the detail pane to open the code in Xcode for editing.

虽然工具可以帮助你检测僵尸,但仍然需要仔细查看相关的内存历史和代码,以便识别和解决问题。以下场景是僵尸的常见原因:Although Instruments can help you detect zombies, you still need to look carefully through the related memory history and your code in order to identify and resolve the problem. The following scenarios are common causes of zombies:

  • 对象已被释放(或自动释放),和您的应用程序试图将它再次发布。An object has already been released (or autoreleased), and your app tries to release it again.

  • 一个对象在它应该被保留时没有被保留。An object hasn’t been retained when it should have been.

  • 另一个调用是在释放对象后对其发出的。Some other call is made to an object after it has been released.

转载于:https://www.cnblogs.com/zyingn/p/Find_Zombies.html

Find Zombies相关推荐

  1. zoj4062 Plants vs. Zombies 二分+模拟(贪心的思维)

    题目传送门 题目大意:有n个植物排成一排,标号为1-n,每株植物有自己的生长速度ai,每对植物浇一次水,该株植物就长高ai,现在机器人从第0个格子出发,每次走一步,不能停留,每一步浇一次水,总共可以走 ...

  2. 什么是僵死进程(Zombies)

    僵死状态(Zombies)是一个比较特殊的状态.有些人认为这个状态是在父进程死亡而子进程存活时产生的.实际上不是这样的.父进程可能已经死了但自己称依然存活着,那个子进程的父进程将会成为init进程,p ...

  3. IOS性能调优系列:使用Zombies动态分析内存中的僵尸对象

    硬广:<IOS性能调优系列>第四篇,预计会有二十多篇,持续更新,欢迎关注. 前两篇<IOS性能调优系列:Analyze静态分析>.<IOS性能调优系列:使用Instrum ...

  4. Plants vs. Zombies(二分)

    文章目录 [Plants vs. Zombies](https://zoj.pintia.cn/problem-sets/91827364500/problems/91827370312) 题意 解题 ...

  5. 植物大战僵尸(Plants vs. Zombies)Mac版本

    游戏介绍 可怕的僵尸即将入侵你的家,唯一的防御方式就是你栽种的植物!武装你的植物,切换他们不同的功能,诸如强悍的豌豆射手或樱桃炸弹,更加快速有效的将僵尸阻挡在入侵的道路上.不同的敌人,不同的玩法构成五 ...

  6. Plants vs. Zombies【二分】

    ZOJ - 4062 Plants vs. Zombies BaoBao and DreamGrid are playing the game Plants vs. Zombies. In the g ...

  7. 关于植物大战僵尸| Plants VS Zombies 运行时 Fatal Error

    系统/System:Win 10 游戏版本Game Version:Plants VS Zombies 1.0 英文原版 下载链接见PZ的贴吧,或: 植物大战僵尸链接 下载的资源无需安装就可直接运行. ...

  8. ZOJ 4062 Plants vs. Zombies(二分答案)

    题目链接:Plants vs. Zombies 题意:从1到n每个位置一棵植物,植物每浇水一次,增加ai高度.人的初始位置为0,人每次能往左或往右走一步,走到哪个位置就浇水一次.求m步走完后最低高度的 ...

  9. TOJ 4120 Zombies VS Plants

    链接:http://acm.tju.edu.cn/toj/showp4120.html4120.   Zombies VS Plants Time Limit: 1.0 Seconds   Memor ...

最新文章

  1. 解决ros安装 使用roscore命令测试问题
  2. DataGrid在分页状态下删除纪录的问题
  3. 提取网页中的链接并生成xml
  4. mysql打印语句_大数据挖掘—(八):scrapy爬取数据保存到MySql数据库
  5. db2去除字段内容空格_Vue CLI3.x 配置指南生产环境去除console
  6. vs 2012 控制台自动关闭
  7. RabbitMQ 核心部分
  8. SCons: A software construction tool
  9. 洛谷——P1219 八皇后
  10. C#得到CPU的序列号、硬盘序列号、网卡序列号
  11. java文件全是数字编码_批量将Java源代码文件的编码从GBK转为UTF-8
  12. android一格一格向上的进度条,如何 使用 ProgressBar 进度条
  13. 美国道富java开发面试题_从事Java开发五年,面试9家拿到7家offer,1096面试+67笔试题...
  14. 20190905 Lombok常用注解
  15. [原创]互联网网站测试经验
  16. deepin允许root登录_王者荣耀安卓免ROOT不用电脑修改战区2020最新版教程
  17. atitit 图像处理机器视觉专业博硕连读课程表.xlsx
  18. 资源管理器 右键 反应慢 现象解决方案
  19. 回顾华为荣耀6手机刷机相关
  20. Hbuilder无法正常运行微信小程序模拟器到指定页面为启动页

热门文章

  1. 【react native】Flatlist实现上拉滚动加载
  2. 我也不晓得为啥要拉这个清单
  3. 一道有意思的数学题(11223344)
  4. 2021MathorCup高校数学建模大数据竞赛解题思路
  5. Linux0.11 execve函数(六)
  6. DPU — Overview
  7. 如何用工业智能网关/数据采集器采集西门子PLC
  8. CODOSYS之结构化文本(ST)—— 初级篇(三)基础-数据类型
  9. MySQL数据库自带基准压力测试工具MySQLSlap使用探索
  10. c++编程猜数字游戏