SafeDK
Sign upAdd Your SDK

A memory leak detection library for Android and Java.

A memory leak detection library for Android and Java.

How does it work? 

  •  RefWatcher.watch() creates a KeyedWeakReference to the watched object. 
  • Later, in a background thread, it checks if the reference has been cleared and if not it triggers a GC. 
  • If the reference is still not cleared, it then dumps the heap into a .hprof file stored on the app file system. 
  • HeapAnalyzerService is started in a separate process and HeapAnalyzer parses the heap dump using HAHA. 
  • HeapAnalyzer finds the KeyedWeakReference in the heap dump thanks to a unique reference key and locates the leaking reference. 
  • HeapAnalyzer computes the shortest strong reference path to the GC Roots to determine if there is a leak, and then builds the chain of references causing the leak. 
  • The result is passed back to DisplayLeakService in the app process, and the leak notification is shown.

SDK for Android

Adding field state details to the text leak trace.

Required Permissions

  •  Write_external_storage

Documentation

Example A

Similar SDKs

MORE

Reviews

Rate Now
0
0
0
0
0
0

Start a new discussion about LeakCanary

×
0
/1000

More from this Developer

  • free

    OPENSOURCE

    OkHttp is an HTTP client that’s efficient by default:- HTTP/2 support allows all requests to the ...

  • free

    OPENSOURCE

    Phrase is an Android string resource templating library.

  • free

    OPENSOURCE

    Moshi is a modern JSON library for Android and Java. It makes it easy to parse JSON into Java obj...

MORE
Login