0
我目前有一個窗口使用視圖來實現導航視圖類型目的。在該導航視圖中,我還添加了一系列視圖。就在最近,我一直在Galaxy S4上出現內存不足錯誤。Appcelerator Studio - 由於內存泄漏導致應用程序崩潰
[WARN] : TiUIScrollView: (main) [1647,1647] Scroll direction could not be determined based on the provided view properties. Default VERTICAL scroll direction being used. Use the 'scrollType' property to explicitly set the scrolling direction.
[WARN] : TiUIScrollView: (main) [173,1820] Scroll direction could not be determined based on the provided view properties. Default VERTICAL scroll direction being used. Use the 'scrollType' property to explicitly set the scrolling direction.
[WARN] : TiUIScrollView: (main) [240,2060] Scroll direction could not be determined based on the provided view properties. Default VERTICAL scroll direction being used. Use the 'scrollType' property to explicitly set the scrolling direction.
[INFO] : art: Clamp target GC heap from 135MB to 128MB
[INFO] : art: Clamp target GC heap from 143MB to 128MB
[INFO] : art: WaitForGcToComplete blocked for 27.099ms for cause Alloc
[INFO] : art: Alloc sticky concurrent mark sweep GC freed 0(0B) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 793us total 8.819ms
[INFO] : art: Clamp target GC heap from 143MB to 128MB
[INFO] : art: Alloc partial concurrent mark sweep GC freed 12(528B) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 793us total 25.634ms
[INFO] : art: WaitForGcToComplete blocked for 32.867ms for cause Background
[INFO] : art: Clamp target GC heap from 143MB to 128MB
[INFO] : art: Alloc concurrent mark sweep GC freed 57(13KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 701us total 39.062ms
[INFO] : art: Forcing collection of SoftReferences for 1101KB allocation
[INFO] : art: Clamp target GC heap from 143MB to 128MB
[INFO] : art: Alloc concurrent mark sweep GC freed 59(2504B) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 549us total 33.752ms
[ERROR] : art: Throwing OutOfMemoryError "Failed to allocate a 1128396 byte allocation with 278738 free bytes and 272KB until OOM"
[ERROR] : TiUIHelper: (main) [525,2585] Unable to load bitmap. Not enough memory: Failed to allocate a 1128396 byte allocation with 278738 free bytes and 272KB until OOM
[INFO] : art: Alloc sticky concurrent mark sweep GC freed 35(3KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 885us total 9.521ms
[INFO] : art: Clamp target GC heap from 143MB to 128MB
[INFO] : art: Alloc partial concurrent mark sweep GC freed 10(384B) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 671us total 26.031ms
[INFO] : art: Clamp target GC heap from 143MB to 128MB
[INFO] : art: Alloc concurrent mark sweep GC freed 5(192B) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 701us total 35.888ms
[INFO] : art: Forcing collection of SoftReferences for 1101KB allocation
[INFO] : art: Clamp target GC heap from 143MB to 128MB
[INFO] : art: Alloc concurrent mark sweep GC freed 3(96B) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 732us total 38.513ms
[ERROR] : art: Throwing OutOfMemoryError "Failed to allocate a 1128396 byte allocation with 278258 free bytes and 271KB until OOM"
[ERROR] : TiUIHelper: (main) [121,2706] Unable to load bitmap. Not enough memory: Failed to allocate a 1128396 byte allocation with 278258 free bytes and 271KB until OOM
[INFO] : art: Alloc sticky concurrent mark sweep GC freed 235(13KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 127MB/128MB, paused 732us total 6.988ms
我可以看到它創建視圖,但它崩潰。我有大約40-50個意見。我正在設法解決這個問題。任何人都有一些提示,或指針?
只是一個提示:當你想在滾動視圖中的圖像 - 首先使用TableView或ListView。並將圖像加載到ImageView對象中而不是視圖 - 這將使平臺更好地管理內存,並且ImageView的位圖加載比視圖更好(在Android上)。 – developer82
@ developer82感謝您的幫助!非常感激。 – Johnny