2016-08-03 155 views
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个意见。我正在设法解决这个问题。任何人都有一些提示,或指针?

回答

0

没关系,修好了!缩小了我的一些图像!

+0

只是一个提示:当你想在滚动视图中的图像 - 首先使用TableView或ListView。并将图像加载到ImageView对象中而不是视图 - 这将使平台更好地管理内存,并且ImageView的位图加载比视图更好(在Android上)。 – developer82

+0

@ developer82感谢您的帮助!非常感激。 – Johnny

相关问题