问题标签 [instruments]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
252 浏览

iphone - 在 Instruments 中运行的 iPhone 应用程序因无法识别的选择器而失败

我有一个应用程序在正常使用中运行似乎没有问题。Clang 静态分析器也没有报告任何问题。当我尝试在 Instruments 中运行它时,它会因无法识别的选择器异常而失败。

违规行是表单的简单属性设置器:

为了弄清楚发生了什么,我在其上方添加了一个 NSLog() 调用:

在模拟器(没有仪器)和设备上,这正是我所期望的:

类 = Foo 响应 = 1

在 Instruments 下运行时,我得到:

类 = Foo 响应 = 0

我对可能导致这种情况的原因感到困惑。当它在 Instruments 环境中时,可能会占用一个不同的内存位置?谁能建议我如何调试它?

0 投票
3 回答
2741 浏览

iphone - iPhone 应用程序的 Shark 和 MallocDebug

我正在尝试优化我正在开发的使用 Cocos2D-iphone 框架的 iPhone 游戏。

我想使用 Shark 来测量性能,但是在 XCode 中禁用了“运行->开始使用性能工具->鲨鱼”(仪器泄漏工作正常)。我已将构建配置为“生成分析代码”,尝试为设备和模拟器构建,但没有运气,鲨鱼仍然保持禁用状态。

我还尝试手动启动 Shark(在 XCode 之外),但同样无效。在“采样->网络/iPhone 采样”下,我选择了“控制共享计算机的网络分析”单选按钮并勾选我列出的设备旁边的复选框。当我按下开始时,什么也没发生。

Shark 适用于桌面应用程序。我正在使用 Shark 4.7.0 (244.4) 和 XCode 3.1.3。我正在 SDK 2.2.1 版上构建 iphone 应用程序。

我需要在 iPhone 上安装一个应用程序才能让 Shark 工作,还是我还缺少其他东西?

0 投票
1 回答
1238 浏览

iphone - iPhone 对象分配,GeneralBlock-24 & GeneralBlock-48

启动 iPhone 应用程序后,我有 3 次内存泄漏。无论我在应用程序中做什么,这些都保持不变(不再泄漏)。

我的净对象分配不断增长。特别是有两个块,GeneralBlock-24 和 GeneralBlock-48。

当程序被使用时,Block-48 变得特别糟糕,占用了兆字节的内存。似乎在两个块中分配对象的库是 QuartzCore。

该应用程序引用了 QuartzCore 框架,但我删除了所有对它的引用。

ps:这都是在设备上,不是模拟器

0 投票
3 回答
5571 浏览

iphone - 未找到符号:启动仪器时的 _CFXMLNodeGetInfoPtr

我正在开发一个 iPhone 应用程序,到目前为止一切正常。我可以在模拟器中构建和启动应用程序。但是当我现在使用 Instruments 启动应用程序时,我得到了错误:

我用谷歌搜索但没有找到解决方案。

希望有人可以帮助我。谢谢

0 投票
2 回答
93 浏览

iphone - 退出仪器“全屏”

我正在为我的 iPhone 应用程序在 Instruments 中进行内存配置文件,然后按下左下角的“全屏”按钮。屏幕变黑了,我不能让它做任何其他事情。当我重新启动盒子时,我会出现启动画面,然后它又变回黑色。请帮忙。

这是一个文档,显示了左下角的按钮。“全屏”

http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/ViewingandAnalyzingData/ViewingandAnalyzingData.html#//apple_ref/doc/uid/TP40004652-CH5-SW6

0 投票
2 回答
8155 浏览

iphone - iPhone OpenGL ES 工具中的 Tiler Utilization 统计数据是什么意思?

我一直在尝试执行一些 OpenGL ES 性能优化,以提高我在 iPhone 应用程序中每秒能够渲染的三角形数量,但我遇到了障碍。我尝试将我的 OpenGL ES 数据类型从固定转换为浮点(根据Apple 的建议),交错我的顶点缓冲区对象,并最大限度地减少绘图状态的变化,但这些变化都没有对渲染速度产生影响。无论如何,我似乎无法在运行 3.0 操作系统的 iPhone 3G 上将我的应用程序推到 320,000 个三角形/秒以上。根据这个基准,我应该能够在这个硬件上使用我正在使用的平滑阴影达到 687,000 个三角形/秒。

在我的测试中,当我在 Instruments 中针对正在运行的设备运行 OpenGL ES 性能工具时,我看到在渲染我的基准测试时统计“Tiler Utilization”达到了近 100%,但“Renderer Utilization”仅达到了大约 30 %。这可能提供了关于显示过程中的瓶颈是什么的线索,但我不知道这些值是什么意思,也没有找到任何关于它们的文档。有人对 iPhone OpenGL ES 仪器中的这个和其他统计数据代表什么有很好的描述吗?我知道 iPhone 3G 中的 PowerVR MBX Lite 是基于tile 的延迟渲染器,但我不确定该架构中的 Renderer 和 Tiler 之间有什么区别。

如果它有任何帮助,如果您想自己下载和测试,可以使用此应用程序的(BSD 许可)源代码。在当前配置中,每次加载新的分子结构时它都会启动一个小基准测试并将三角形/s 输出到控制台。

0 投票
4 回答
4991 浏览

objective-c - 如何删除 NSString 相关的内存泄漏?

在我的应用程序中,此方法显示内存泄漏如何消除泄漏?

这种方法也显示泄漏......这种方法有什么问题?

}

替代文字 http://www.freeimagehosting.net/uploads/5b8120982c.png

0 投票
5 回答
6935 浏览

iphone - 了解用于内存泄漏检查的工具 - iPhone

替代文字

上面给出的图像是我的应用程序泄漏。

在这里,我想了解,在扩展细节中 - 您可以看到不同的颜色,如浅绿色、浅粉色、浅棕色、浅紫色。

每种颜色代表什么?

现在另一个困惑是“如何定位造成内存泄漏的代码?”

内存泄漏达到什么限制 - 实际的 iPhone 可以继续使用。(假设 10 字节没问题,20 字节没问题 & 200 字节有问题)

  • 每种颜色代表什么?
  • 哪种颜色表示我们的代码/从哪个细节我们可以得到我们分配对象并忘记释放它的代码?

(例如 - 在详细点击 UIKit 第二个单元格时 - 我们无法获取代码)

  • 为什么我们必须解决所有的泄漏?- 即使是一次泄漏也会堵塞 iPhone 吗?
  • 为什么 iPhone 允许泄漏保留在内存中?/ 为什么应用程序终止后没有自动完成垃圾收集?
  • 如果我尝试根据工具释放应该释放的对象,我的应用程序会异常终止。如果我不解除分配,我的应用程序运行完美,如何?
  • 为什么建议您在视图中等待 10 秒或更长时间,如果有泄漏,仪器会检测到泄漏?
0 投票
1 回答
3861 浏览

iphone - Objective C NSCFString Leaks with NSMutableArrays

I am cleaning up my code in a phonebook iPhone application and the Leaks tool in Instruments is reporting that I am leaking NSCFString objects. Here is the pattern that I am following:

I have a Person class in my application that has nothing more than local NSString members and associated properties for first name, last name, etc.

My view controller has an NSMutableArray property that is populated from a SQLite database in the searchBarSearchButtonClicked event. This NSMutableArray is populated with Person object(s) that will be used to populate my tableview control. Also, if the user clicks on a person in the view, their Person object will be passed to the Detail view for viewing additional information than just the name.

When I perform my first look up and display the results there are no memory leaks.

Now, when I perform my second look up I would ideally like to clear out the NSMutableArray and reload it with the new result set without leaking memory. So, to do this, I call removeAllObjects on my personList property and then call the database to repopulate the personList NSMutableArray as shown below:

By calling removeAllObject I've gotten rid of the leaks that I used to have that were associated with the Person objects. However, it appears that I am now leaking the NSString objects left over from the properties of the individual Person objects.

Is this possible?

I am new to the Instruments tool but from what I can tell from the Extended Detail when I drill into one of the NCSFString leaks is that last line of code in the stack is often pointing to the @synthesize line of code for the property, such as:

So, that is why I think those NSStrings are not getting cleaned up. Is there a better way to do this that doesn't produce memory leaks?

0 投票
1 回答
185 浏览

iphone - 大小为 16 字节的泄漏 UIImage 可能表明什么?

16 字节很小,对吧?我在我的应用程序中创建的 UIImage 都没有那么小,但是 Leaks Instrument 报告了一个大小为 16 字节的泄漏 UIimage...关于这可能是什么的任何线索?顺便说一句,还有一个泄露的 48 字节的 CALayer 对象......