安卓:恒内存消耗/ dumpGfxInfo() [英] Android: Constant memory consumption / dumpGfxInfo()
问题描述
假设:使用Android工作室向导,创建一个简单的活动,而不在任何自定义code,永远消耗内存调用dumpGfxInfo()
Given: A simple Activity created with the Android Studio Wizard, without any custom code inside, consumes perpetually memory calling dumpGfxInfo().
而Android Studio的建立在分配追踪器至少揭示了的三的做同样的主题:
The Android Studio's build in Allocation Tracker reveals at least three threads doing the same:
--- 8< ------------------------------------------------------------------
* < Thread 12 >
* execTransact():446, Binder (andoroid.os)
* onTransact():545, ApplicationThreadNative (android.app)
* dumpGfxInfo():1107, ActivityThread$ApplicationThread (android.app)
--- 8< -------------------------------------------------------------------
显然dumpGfxInfo()通过为空字符串分配内存消耗内存。编译唯一相关的依赖,是的 com.android.support:appcompat-v7:22.2.1 的
随着这种内存消耗,以下异常(有时)出现了:
Along with this memory consumption, following exception (sometimes) arises:
15331-15364/ W/Binder﹕ Caught a RuntimeException from the binder stub implementation.
java.lang.NullPointerException: Attempt to read from field 'android.view.HardwareRenderer android.view.View$AttachInfo.mHardwareRenderer' on a null object reference
at android.view.WindowManagerGlobal.dumpGfxInfo(WindowManagerGlobal.java:466)
at android.app.ActivityThread$ApplicationThread.dumpGfxInfo(ActivityThread.java:1107)
at android.app.ApplicationThreadNative.onTransact(ApplicationThreadNative.java:548)
at android.os.Binder.execTransact(Binder.java:446)
问:如何修复/关闭此行为,并摆脱它
Question: How to fix/turn off this behaviour and get rid of it?
推荐答案
好像它是最新的Android工作室的bug。 较早的版本没有这个问题。 请参阅<一href="https://$c$c.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=182869&">this链接
Seems like it's latest Android Studio bug. Older versions don't have this issue. See this link
这篇关于安卓:恒内存消耗/ dumpGfxInfo()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!