Skip to content

0x03e LeakMemory_en

hui.zhao edited this page Mar 25, 2020 · 5 revisions

LeakMemory

Extra dependencies

AndroidGodEye use LeakCanary to analyze memory leak, you need to add dependency as following

implementation 'cn.hikyson.godeye:godeye-leakcanary:VERSION_NAME'

This library is conflict with Leakcanary, if you have already depends on Leakcanary, you should add this dependency

Install

Use the following configuration to install

GodEye.instance().install(GodEyeConfig.defaultConfigBuilder().withLeakConfig(new GodEyeConfig.LeakConfig()).build());

or

<leakCanary />

Production and consumption of data

Use the following methods to observe the output:

try {
            GodEye.instance().observeModule(GodEye.ModuleName.LEAK_CANARY, new Consumer<LeakInfo>() {
                @Override
                public void accept(LeakInfo leakInfo) throws Exception {
                }
            });
        } catch (UninstallException e) {
            e.printStackTrace();
        }

leakInfo will be output after analyzd leak info.

DebugMonitor Dashboard

android_god_eye_leak

Clone this wiki locally