接收内存警告,但消费者更少

时间:2011-11-08 08:01:57

标签: ios memory-management

我正在做类似照片浏览器的应用,就像iTOuch上的“照片”一样。我使用第三方库:https://github.com/kirbyt/KTPhotoBrowser 当我多次滚动照片时,应用程序崩溃了。 日志显示它已收到内存警告。

然后我用仪器检查内存(我选择内存分配)。

我跟踪“所有分配”的实时字节和总字节数。 但是,实时字节数不会超过5 MB,总字节数超过100 MB。

当应用程序运行时,Live Bytes为3.97MB,总体为125.48MB。

我认为Live Bytes是目前使用的内存,而且似乎花费了一点。

为什么应用程序仍然崩溃? Xcode 4.2 4D199,Lion 10.7.2(11c74),iTouch ios5.0.1 beta2。 下面是截图,仪器配置是默认配置。 enter image description here

有什么想法吗?

崩溃日志如下:


Nov  8 16:54:42 unknown SpringBoard[15] : Received memory warning.
Nov  8 16:54:43 unknown com.apple.launchd[1] : (UIKitApplication:com.apple.mobilephone[0xcb31]) Exited: Killed: 9
Nov  8 16:54:43 unknown com.apple.launchd[1] : (UIKitApplication:com.freebit.minimumcloud.ios[0xf787]) Exited: Killed: 9
Nov  8 16:54:43 unknown UserEventAgent[12] : jetsam: kernel termination snapshot being created
Nov  8 16:54:43 unknown SpringBoard[15] : Application 'Min.Cloud' exited abnormally with signal 9: Killed: 9
Nov  8 16:54:44 unknown SpringBoard[15] : Application 'FaceTime' exited abnormally with signal 9: Killed: 9
Nov  8 16:54:45 unknown kernel[0] : launchd[481] Builtin profile: container (sandbox)
Nov  8 16:54:45 unknown kernel[0] : launchd[481] Container: /private/var/mobile/Applications/301E2A00-F1B6-4E88-ACF4-8EBEFB92B9DA [69] (sandbox)
Nov  8 16:54:45 unknown librariand[459] : client connection is invalid: Connection invalid
Nov  8 16:54:45 unknown ReportCrash[480] : Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2011-11-08-165445.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Nov  8 16:54:49 unknown sandboxd[483] : MinimumCloud(481) deny file-write-data /private/var/mobile/Library/Mobile Documents/*********
Nov  8 16:54:50 unknown MinimumCloud[481] : file://localhost/private/var/mobile/Library/Mobile%20Documents/*******/Documents/
Nov  8 16:54:50 unknown sandboxd[483] : MinimumCloud(481) deny file-write-create /file:
Nov  8 16:54:50 unknown MinimumCloud[481] : ubiquityContainerURL=/private/var/mobile/Library/Mobile Documents/******/Documents
Nov  8 16:54:50 unknown sandboxd[483] : MinimumCloud(481) deny file-write-create /file:
Nov  8 16:54:50 unknown MinimumCloud[481] : mystorageSymLink=/var/mobile/Applications/301E2A00-F1B6-4E88-ACF4-8EBEFB92B9DA/Library/htdocs/MyStorage
Nov  8 16:54:51 unknown wifid[27] : WiFi:[342435291.518957]: Disable WoW requested by "spd"

1 个答案:

答案 0 :(得分:0)

这是我自己的错! 当我使用NSURLConnection来检测文件的MIME-TYPE时,连接的内存永远不会释放,它会变得越来越大(因为我检测到超过100个文件的类型)。

我重建了代码。