Untangle your App: Efficient Threading in Android
summary
Explains where Android and RxJava actually create native threads and why apps hit pthread_create ENOMEM, tying it to 140 KB stacks for worker threads vs 8 MB main thread, RLIMIT_NPROC limits (≈9,500 on a Nexus 6P, ≈1,000 on older phones), and vm.max_map_count/mmap virtual memory caps. Compares single-thread executors, bounded round‑robin pools (deadlock/thread‑starvation risk) and unbounded IO pools (OOM risk), and shows an RxJava scheduler wrapper used to monitor and reduce unnecessary worker creation.
AI-written summary · about
chapters (14)
- 0:00Introduction to Android threading
- 1:10Main thread mechanics
- 2:36Thread starvation deadlock
- 4:03Thread pool limitations
- 6:31Out of memory errors
- 12:10Thread creation limits
- 16:03Memory mapping constraints
- 19:34Why threading remains hard
- 19:55RX Java schedulers overview
- 22:46Worker and thread behavior
- 24:53Computation scheduler details
- 27:21IO scheduler behavior
- 28:23Threading in RX vs Java
- 29:05Closing thoughts on threading
related talks
30mExtra! Extra! Thread all about it!
28mInside Android asynchronous processing: Understanding the Event Loop
30mExtra! Extra! Thread all about it!
42mAndroid Internals for Developers
55mControlling Multi-Core Race Conditions on Linux/Android
38mA Busy Android App Developers' Guide to Perfetto
49mWhat Mom Never Told You About Multi-Threading
11mImproving App Performance With Custom Thread Pools
