Android的EdgeEffect似乎分配1兆位图 [英] Android EdgeEffect appears to allocate a 1 meg bitmap
问题描述
我们正在运行内存分析工具在我们的应用程序来优化它。我们注意到,它总是标志的大型1127584字节位图作为一个可能的内存泄漏。
We were running Memory Analyzer Tool in our application to optimize it. We noticed that it always flags a large 1,127,584 byte Bitmap as a possible memory leak.
在分析过程中,我们意识到它无关,与我们的应用程序,只是创造与任何包含滚动部件会显示相同的结果显示在屏幕快照,标志图中单个布局一个简单的项目。
During analysis, we realized that it has nothing to do with our app and just creating a simple project with a single layout that contains any scrollable widget will show the same results as shown in the screenshot which flags the Bitmap.
问题是 - 任何人都知道这个形象是和我们应该用它担心
Question is -- anyone know what this image is for and should we be concerned with it?
推荐答案
这是一个迟到的答案,但也许这将帮助别人,我有一个类似的问题,我见过一些大的位图服用相对大量的内存,在Android工作室堆转储,我发现它从滚动视图,所以我已经添加了这个属性的XML来禁用滚动视图效果,我不再看到堆转储该分配。
this is a late answer but maybe this will help others,I had a similar issue i've seen some big bitmap taking relatively a lot memory in the android studio heap dump, i found out it came from the scrollview so I've added this attribute to the xml to disable the scrollview effects and i dont see this allocation anymore in the heap dump.
安卓overScrollMode =从不
android:overScrollMode="never"
P.S
我现在可以看到在微调DropDownListVew,当它开启了同样的问题堆转储
p.s I can see now in the heap dump that the spinner DropDownListVew, when its opened has the same issue
这篇关于Android的EdgeEffect似乎分配1兆位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!