[英]CollectionView memory VM:CoreAnimation memory allocated and abandoned
[英]iOS Abandoned memory VM: Image IO
我有這樣的問題。 我正在開發一個 iPad 應用程序,它實際上使用了大量的圖像和核心動畫內容。 我沒有泄漏,但我已經放棄了內存問題。 我有一個穩定的記憶增長。 我禁用了實際使用大量內存的動畫,但我仍然遇到內存增長問題。 對於動畫,我使用http://markpospesel.wordpress.com/2012/05/07/mpfoldtransition/ 。 我已將 UIImage 類中此類加載方法的實現替換為“imageNamed:”等。仍然無濟於事。
如果有人有任何想法,請幫助。
感謝大家。
+ (UIImage *)imageNamed:(NSString *)name {
NSString *pathExtension = [name pathExtension];
name = [name stringByDeletingPathExtension];
if ([pathExtension isEqualToString:@""]) {
pathExtension = @"png";
}
NSString *sufix = [BMKAppUtilites isRetina] ? @"@2x" : @"";
name = [name stringByAppendingString:sufix];
name = [name stringByAppendingPathExtension:pathExtension];
name = [[NSBundle mainBundle] pathForResource:[name stringByDeletingPathExtension] ofType:[name pathExtension]];
return [[self alloc] initWithData:[NSData dataWithContentsOfFile:name options:NSDataReadingUncached error:NULL] scale:[BMKAppUtilites scaleFactor]];
}
編輯:我剛剛注意到這個問題已經超過 6 年了。 😆
—
看起來很像某些東西仍然對您的圖像有很強的參考。 我會說,根據您向我們展示的數據,您最好的選擇是從 Xcode 運行並在內存圖中暫停以查看具有強引用的內容。 不要忘記在您的方案中打開 malloc 堆棧跟蹤,以便跟蹤內存分配的位置。 祝你好運。
如果您從未使用過 Xcode 內存圖,這可能會有所幫助: https : //developer.apple.com/documentation/xcode/improving_your_app_s_performance/reducing_your_app_s_memory_use/gathering_information_about_memory_use
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.