Speaker Deck

Advanced Techniques for concurrency and memory management

by Nabil Hachicha

Published October 29, 2015 in Programming

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)