~/talk

GC You Later, Allocator

Talkat droidcon New York 2024 · 2024-09-19..09-20· [android]
links:none on file
slides:none on file

A Kotlin Multiplatform sample app leaks a listener each time a dialog opens, creating 6 leaked NearbyGatorsContent instances that are trivial to find in Android Studio + LeakCanary + YourKit but still present in Xcode until addressed. The root cause is a cross-language retain cycle between Kotlin native and Swift reference counting; fixing on Android by removing the listener works, while on iOS the solution is to extract the listener and break the cycle with a weak listener and use Xcode malloc stack logging to get allocation sites.

AI-written summary · about

  1. 0:00Introduction
  2. 3:15Alligator-themed app demo
  3. 7:11Logical vs physical memory
  4. 11:26Allocators bridge memory
  5. 14:56GC vs reference counting
  6. 18:57Memory leaks in apps
  7. 21:05Finding leaks with Profiler
  8. 22:50Xcode memory tips
  9. 27:43Command-line memory tools
  10. 28:47Fixing leaks with tools
  11. 30:35Kotlin Multiplatform leaks
  12. 33:47Retain cycles in Kotlin Native
  13. 36:00Preventing memory leaks
  14. 39:53Summary and Valhalla bonus
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.