- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
随着时间的推移,我目前正在处理的应用程序正在积累越来越多的内存。这并不是真正的内存泄漏,因为 Leaks 工具不会将其识别为泄漏,但它会不断占用越来越多的内存。
我一直在使用 Instruments(内存分配工具)找出为什么会发生这种情况,现在我正在制作堆快照,以便找到运行周期中不同点之间的内存差异。似乎在每个循环之后,使用的内存增加了大约 560 KB。
这是它在 Instruments 工具中的样子:
并且在选择 CFString 行时:
右侧的完整 Stack Trace 如下所示:
0 CoreFoundation _CFRuntimeCreateInstance
1 CoreFoundation __CFStringCreateImmutableFunnel3
2 CoreFoundation CFStringCreateWithBytes
3 Foundation -[NSString initWithCoder:]
4 Foundation _decodeObject_old
5 SyncServices -[ISDProperty initWithCoder:]
6 SyncServices -[ISDRelationship initWithCoder:]
7 Foundation _decodeObject_old
8 Foundation _decodeValueOfObjCType
9 Foundation -[NSUnarchiver decodeValueOfObjCType:at:]
10 Foundation -[NSArray(NSArray) initWithCoder:]
11 Foundation _decodeObject_old
12 SyncServices -[ISDEntity initWithCoder:]
13 Foundation _decodeObject_old
14 Foundation _decodeValueOfObjCType
15 Foundation -[NSUnarchiver decodeValueOfObjCType:at:]
16 Foundation -[NSArray(NSArray) initWithCoder:]
17 Foundation _decodeObject_old
18 SyncServices -[ISDRelationship initWithCoder:]
19 Foundation _decodeObject_old
20 Foundation _decodeValueOfObjCType
21 Foundation -[NSUnarchiver decodeValueOfObjCType:at:]
22 Foundation -[NSArray(NSArray) initWithCoder:]
23 Foundation _decodeObject_old
24 SyncServices -[ISDEntity initWithCoder:]
25 Foundation _decodeObject_old
26 Foundation _decodeValueOfObjCType
27 Foundation -[NSUnarchiver decodeValueOfObjCType:at:]
28 Foundation -[NSArray(NSArray) initWithCoder:]
29 Foundation _decodeObject_old
30 SyncServices -[ISDRelationship initWithCoder:]
31 Foundation _decodeObject_old
32 Foundation _decodeValueOfObjCType
33 Foundation -[NSUnarchiver decodeValueOfObjCType:at:]
34 Foundation -[NSArray(NSArray) initWithCoder:]
35 Foundation _decodeObject_old
36 SyncServices -[ISDEntity initWithCoder:]
37 Foundation _decodeObject_old
38 Foundation _decodeValueOfObjCType
39 Foundation -[NSUnarchiver decodeValueOfObjCType:at:]
40 Foundation -[NSArray(NSArray) initWithCoder:]
41 Foundation _decodeObject_old
42 SyncServices -[ISDRelationship initWithCoder:]
43 Foundation _decodeObject_old
44 Foundation _decodeValueOfObjCType
45 Foundation -[NSUnarchiver decodeValueOfObjCType:at:]
46 Foundation -[NSArray(NSArray) initWithCoder:]
47 Foundation _decodeObject_old
48 SyncServices -[ISDEntity initWithCoder:]
49 Foundation _decodeObject_old
50 Foundation +[NSUnarchiver unarchiveObjectWithData:]
51 SyncServices -[ISDObjectGraphWrapper initWithCoder:]
52 Foundation -[NSKeyedPortCoder decodeObjectForKey:]
53 Foundation -[NSArray(NSArray) initWithCoder:]
54 Foundation -[NSKeyedPortCoder decodeObjectForKey:]
55 Foundation -[NSKeyedPortCoder _decodeObjectNoKey]
56 Foundation -[NSKeyedPortCoder _walkAndDecodeDataWithType:at:chase:invocation:inStructure:]
57 Foundation decodeInvocationArguments
58 Foundation -[NSKeyedPortCoder decodeInvocation]
59 Foundation -[NSKeyedPortCoder decodeObjectForKey:]
60 Foundation -[NSConnection handleRequest:sequence:]
61 Foundation -[NSConnection handlePortCoder:]
62 Foundation -[NSConnection dispatchWithComponents:]
63 Foundation __NSFireMachPort
64 CoreFoundation __CFMachPortPerform
65 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
66 CoreFoundation __CFRunLoopDoSource1
67 CoreFoundation __CFRunLoopRun
68 CoreFoundation CFRunLoopRunSpecific
69 Foundation -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
70 SyncServices -[ISyncConcreteSession _waitForTransitionFromPhase:untilDate:]
71 SyncServices +[ISyncSession _sessionWithClient:entityNames:beforeDate:clientHasTruthForEntityNames:quietlyPushTruth:target:selector:anchors:hasChanges:skip:error:]
72 SyncServices +[ISyncSession beginSessionWithClient:entityNames:beforeDate:]
73 SyncServices -[ISyncConcreteSessionDriver _beginSyncSession:]
74 SyncServices -[ISyncConcreteSessionDriver _preSync]
75 SyncServices -[ISyncConcreteSessionDriver _sync:]
76 SyncServices -[ISyncConcreteSessionDriver sync]
77 **Our application** - [SLSyncOperation performLocalSync] /Users/andrei/Desktop/MacOSX_Client/osx/Classes/SLSyncOperation.m:94
78 **Our application** -[SLSyncOperation main] /Users/andrei/Desktop/MacOSX_Client/osx/Classes/SLSyncOperation.m:251
79 Foundation -[__NSOperationInternal start]
80 Foundation ____NSOQSchedule_block_invoke_2
81 libdispatch.dylib _dispatch_call_block_and_release
82 libdispatch.dylib _dispatch_worker_thread2
83 libsystem_c.dylib _pthread_wqthread
84 libsystem_c.dylib start_wqthread
我正在使用 SyncServices 来获取联系信息。我正在使用 ISyncSessionDriver 以特定时间间隔(10 秒,也可以在内存分配图像上看到)检查(同步)新信息。代码如下所示。
SLSyncSessionDriverDataSource *dataSource = [[SLSyncSessionDriverDataSource alloc] initWithManagedObjectModel:managedObjectModel context:managedObjectContext];
ISyncSessionDriver *localDriver = [ISyncSessionDriver sessionDriverWithDataSource:dataSource];
SLSyncSessionDriverDelegate *theDelegate = [[SLSyncSessionDriverDelegate alloc] init];
[localDriver setDelegate:theDelegate];
[theDelegate release];
[dataSource release];
[localDriver sync];
感谢您能给我的任何帮助!
最佳答案
假设您发现了真正的泄漏,一些想法:
您只能在可能有新内容时运行同步信息(注意 ~/Library/Application 中的变化
)。
使用 kqueue 或 FSEvents 支持/地址簿
您可以在您定期回收的子进程中运行同步,或者根据之前的建议,只运行一次进程执行同步然后退出。
Sync Services 从来没有很好地工作过,并且从 10.7 开始就被弃用了,所以我想如果有任何额外的工作,它也不会看到太多。我不认为想出一个独立的例子是浪费时间 submit it as a bug ,特别是如果它漏得这么厉害。此外,我建议在地址簿框架上提交另一个错误,说明您希望能够检查/收到新信息/更新信息的通知。
关于objective-c - Foundation框架导致的 "memory leaks"怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7177498/
我想加载带有本地回退的 foundation.min.js 的 CDN 版本。问题是:如何检测是否加载了 foundation.js? 我看到它是用 jQuery、modernizr、Bootstra
我从 v3 开始就一直在使用 Foundation,所以我没想到会出现这种困惑。 在这种特殊情况下,我需要一个固定宽度的左列(大 3),然后是一个流动/响应内容列(大 9)作为其余部分。
我在从最新的 Foundation 定制 Orbit 时遇到问题。来自 the docs : Orbit 选项此时只能在初始化时传入。 { timer_speed: 10000, animat
在以下非常基本的示例中,开关可以正常工作并且样式正确。如果我只是将 foundation.css 版本从 5.5.2 更改为 6.0.5,切换样式就会丢失。为什么开关在 Foundation 6.0
如何禁用中/小屏幕的顶部栏折叠? 我按照 Here 中的说明进行操作但无论我将最小宽度设置为什么,我都会得到相同的结果。 最佳答案 如果您使用的是 SCSS 版本,那么您可以修改断点。 $topbar
出于多种原因,复选框在最新的 Foundation (4.1.6) 中存在问题。有没有一种简单的方法可以阻止 Foundation 接管它们?我需要 custom我的类 form s 其他原因。我如何
我希望在显示模式窗口中播放的视频在模式窗口关闭时停止播放(谁不呢?)。通过将 iframe 源设置为空,可以使用 jQuery 轻松完成此操作。 但我不知道如何让它在回调中工作。模态窗口本身按预期运行
我最近开始将 Zurb Foundation 4 用于 Asp MVC 网站,但我不太明白开关控件应该如何工作。文档没有说太多 http://foundation.zurb.com/docs/comp
是否可以合并top-bar和 tab-bar ( Canvas 外)? 这个: 调整到手机尺寸时变成这样: 但我还想包括标签栏( Canvas 外)所以它变成这样 我无法想象这是如何做到的,我试图制作
我的问题是,在桌面上我喜欢先有菜单,然后是最右上角的标志。目前,当我将模板缩小到移动版本时, Logo 位于菜单下方,这并不令人满意。我想在菜单之前吃。我试过使用推/拉没有成功。 在移动 View 中
我直接从他们的网站 https://foundation.zurb.com/sites/docs/top-bar.html 复制了基础导航栏语法并且下拉菜单功能似乎不起作用 代码如下:
刚刚切换我的 Rails 项目以测试 Zurb Foundation 5,现在切换顶部栏菜单不起作用。 当视口(viewport)很小时,顶部栏菜单项消失并且菜单图标像以前一样显示,但是当我单击菜单图
如何在 Foundation 4 中以编程方式显示模态? 在 Foundation 3 中,我们有易于使用的 reveal() 方法。 您可以在 Foundation 4 中使用什么?请帮忙。 最佳答
我正在使用启用了 flexbox 的 Foundation 6 Zurb 模板,但按钮组的扩展功能不起作用。 当我添加扩展类时,最后一个按钮不会填满最后一个空格并掉到左侧的下一行。文本不再内联,按钮的
我正在使用 Zurb Foundation 并具有以下 html: Tab 1 Content of section 1. Tab
我正在尝试使用 zurb Foundation 5 显示模式。但是当我单击按钮时它不起作用并且无法打开。我正在使用这个 html 代码。 index Awesome. I ha
有什么我可以在命令行中输入的东西来找出我正在运行的版本吗? 最佳答案 在不了解您的具体情况的情况下,最简单的方法是在初始化 Foundation ( $(document).foundation();
Foundation 5 上曾经有一个“圆形”类,可以将按钮组转换为具有圆形边缘。我如何在 Foundation 6 中执行此操作? 最佳答案 这在 Foundation 6 中是不可能的。为了减小文
我正在使用 Zurb 的 Foundation 4.2.3,但是当我打印页面时,网格布局始终没有得到维护。 例如, XXX Lorem
作为 Zurb's Foundation 一部分的轨道 slider 好像加了一个类hide-for-small到导航。 我需要导航仍然显示,以便显示我的内容。我试过删除 hide-for-small
我是一名优秀的程序员,十分优秀!