我得到了幾個內存泄漏。所有代碼都有最後的地方 - [ASIHTTPRequest somemethod]。早些時候,我認爲這是ASIhtt Library泄漏內存。然而,它看起來可能只是指向創建對象的地方,而泄漏的原因實際上是在代碼中。下面是一個內存泄漏堆棧的例子。我需要知道如何解決這些問題。我應該怎麼做?謝謝內存泄漏。我如何去修復它們
0 CoreFoundation _CFStreamSetClient
1 CoreFoundation CFReadStreamSetClient
// Below are Within code
2 ProductSurvey -[ASIHTTPRequest scheduleReadStream] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Networking/ASIHTTP/ASIHTTPRequest.m:3716
3 ProductSurvey -[ASIHTTPRequest startRequest] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Networking/ASIHTTP/ASIHTTPRequest.m:1382
4 ProductSurvey -[ASIHTTPRequest main] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Networking/ASIHTTP/ASIHTTPRequest.m:955
5 ProductSurvey -[ASIHTTPRequest startSynchronous] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Networking/ASIHTTP/ASIHTTPRequest.m:802
6 ProductSurvey -[BaseRequest __processRequest:] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Networking/WebServices/../BaseRequest.m:73
7 ProductSurvey -[BaseRequest request] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Networking/WebServices/../BaseRequest.m:109
8 ProductSurvey -[EntityRevisionCheckRequest request] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Networking/WebServices/EntityRevision/EntityRevisionCheckRequest.m:21
9 ProductSurvey +[NetworkUtility revisionForEntityId:] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Networking/Utilities/NetworkUtility.m:21
10 ProductSurvey -[AbstractEntity(Extension) toJSONForUpdate] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/DataPersistance/Categories/AbstractEntity+Extension.m:65
11 ProductSurvey -[Room(Extension) toJSONForUpdate] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/DataPersistance/Categories/Room+Extension.m:104
12 ProductSurvey -[RoomService push] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Syncing/Services/RoomService.m:56
13 ProductSurvey +[SyncService pushEntityData:] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Syncing/SyncService.m:84
14 ProductSurvey +[SyncService pushInOrder:] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Syncing/SyncService.m:291
15 ProductSurvey +[SyncService pushAllDirtyChangesToServer] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Syncing/SyncService.m:69
16 ProductSurvey +[SyncService push:] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Syncing/SyncService.m:479
17 ProductSurvey +[SyncService syncLocalRemoteData] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Syncing/SyncService.m:220
18 ProductSurvey -[BGSyncService processSync] /Users/Ila/Documents/Developer/Stryker/ProductSurvey/Syncing/BGSyncService.m:77
19 Foundation __NSThread__main__
20 libsystem_c.dylib _pthread_start
21 libsystem_c.dylib thread_start
這是儀器本身的疊加。我正在使用它,而且我打包了代碼位置,但我無法看到泄漏的原因。我是否應該發佈在此堆棧中顯示的所有方法的代碼? – ila
如果你開始發佈個別方法的代碼,那將是非常乏味的。更好地閱讀文檔。 – 2013-07-24 13:01:17