Code samples:
Looper: https://gist.github.com/nhachicha/e993fe9b5f09f0595ccd
PhantomReference: https://gist.github.com/nhachicha/4ba780712a7ae179cc67
Synchronizers: https://gist.github.com/nhachicha/7596e912c81aae38d721
Managing memory & concurrency are one of the biggest challenges we face when it comes to writing testable & efficient apps.
based on the experience of building Realm, We'll dig into some patterns & tricks used to control memory footprint & multithreading.
Some of the topics this talks will cover are:
How to use the Java Reference API (WeakReference & ReferenceQueue) to work with the GC
Writing tests involving the GC
Working & testing code using the Handler/Looper api
Alternative asynchronous models (Messenger/ResultReceiver)
Threadpool customisation & pitfalls
Handler (mocking & testing, using IdleHandler)