Using LeakCanary with HPROF File?

482 views Asked by At

Short Question: Is it somehow possible to use the LeakCanary library with just the HPROF File and find leaks that way?

I already tried different stuff but failed as I dont have a KeyedWeakReference. I looked through all the classes and I am not 100% sure if I could create that by myself.

Has anyone every tried a scenario like this or is this library not suitable for this case?

Thanks!

1

There are 1 answers

0
Kevin Ding On

I found this , hope it can help you Leak-canary provides a Heap file analysis engine named Shark you can either call it by shark api or shark command line

you can download tools from this URL, https://square.github.io/leakcanary/shark/

or just compile it by downloading source code and building from leakcanary github website.

you can analyze heap file by the following commandline:

shark-cli --hprof memory.dump analyze

or just by

shark-cli -p analyze