-
Notifications
You must be signed in to change notification settings - Fork 347
0x03e LeakMemory_en
hui.zhao edited this page Mar 25, 2020
·
5 revisions
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
Use the following configuration to install
GodEye.instance().install(GodEyeConfig.defaultConfigBuilder().withLeakConfig(new GodEyeConfig.LeakConfig()).build());
or
<leakCanary />
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.