Android: Constant memory consumption / dumpGfxInfo()
Asked Answered
B

3

25

Given: A simple Activity created with the Android Studio Wizard, without any custom code inside, consumes perpetually memory calling dumpGfxInfo().

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< -------------------------------------------------------------------

Apparently dumpGfxInfo() consumes memory by allocating memory for empty strings. The only relevant dependency compiled in, is 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?

Brigidabrigit answered 15/8, 2015 at 12:7 Comment(0)
M
20

Seems like it's latest Android Studio bug. Older versions don't have this issue. See this link

Marston answered 17/8, 2015 at 8:29 Comment(5)
Thank you very much for your answer.Brigidabrigit
This is happening in the emulator when I am testing marker interactions. What does it have to do with Android Studio??Often
@Often have a look at question text. Even empty projects have this problem: 'A simple Activity created with the Android Studio Wizard, without any custom code inside, consumes perpetually memory calling dumpGfxInfo().'Marston
and comment from google guys: 'Thanks for the report. Yes, monitoring the GPU has a small memory impact (no memory leak, just activity). We'll be adding a fix soon where you can pick which monitors you want enabled, and we'll be setting the gpu monitor as disabled by default.'Marston
It's probably a bug in the Android SDK, not Android Studio.Raspberry
L
28

For further reference and for anyone coming here: you have to disable GPU profiling since it's not disabled by default ( Android Studio 2.1 Preview 4 ). You find the button in 'Monitors' section (check out the image below)enter image description here

Leisurely answered 31/3, 2016 at 22:50 Comment(2)
Thank you man. I was trying to find a memory leak in my app since two days as it was constantly showing increase in memory spikes. Turns out the buffoon of an android studio was constantly monitoring my GPU and hogging my memory :\Illegitimate
Thanks a lot man, I also spent the last two days trying to find a leak. This was exactly what I needed.Reflux
M
20

Seems like it's latest Android Studio bug. Older versions don't have this issue. See this link

Marston answered 17/8, 2015 at 8:29 Comment(5)
Thank you very much for your answer.Brigidabrigit
This is happening in the emulator when I am testing marker interactions. What does it have to do with Android Studio??Often
@Often have a look at question text. Even empty projects have this problem: 'A simple Activity created with the Android Studio Wizard, without any custom code inside, consumes perpetually memory calling dumpGfxInfo().'Marston
and comment from google guys: 'Thanks for the report. Yes, monitoring the GPU has a small memory impact (no memory leak, just activity). We'll be adding a fix soon where you can pick which monitors you want enabled, and we'll be setting the gpu monitor as disabled by default.'Marston
It's probably a bug in the Android SDK, not Android Studio.Raspberry
B
1

The described behavior was fixed in the latest SDK update 1.4 Beta (Build AI-141.2202261).

Brigidabrigit answered 28/8, 2015 at 23:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.