Tagged articles
RunLoop
18 articles · Page 1 of 1
This article explains why iOS apps experience UI lag, outlines common causes such as heavy UI rendering and synchronous network calls, compares three mainstream lag‑monitoring approaches (Ping thread, FPS, RunLoop), and details a RunLoop‑based solution that captures precise stack traces with minimal performance overhead.
RunLoopiOSlag detection
0 likes · 13 min read

This article dives deep into iOS timing mechanisms, explaining how CADisplayLink synchronizes with the screen refresh, how NSTimer works, the role of RunLoop modes, common memory‑leak pitfalls, and practical code solutions for smooth animations and accurate frame‑rate handling across iOS versions.
CADisplayLinkNSTimerRunLoop
0 likes · 31 min read

An OOM crash in the K‑song iOS karaoke app was traced to a configuration that swizzled several NSMutableArray methods, causing each observer lookup to autorelease objects, rapidly filling autorelease‑pool pages and exhausting memory; converting the protection code to manual reference counting eliminated the leak and stopped the crashes.
AutoreleasePoolMemory LeakOOM
0 likes · 21 min read

This article explains the principles, usage, and internal mechanisms of CADisplayLink and NSTimer in iOS, compares their advantages and drawbacks, discusses common pitfalls such as retain cycles, explores RunLoop modes and sources, and provides code examples and solutions for reliable timer handling.
CADisplayLinkNSTimerRunLoop
0 likes · 24 min read

This article provides an in‑depth technical overview of iOS RunLoop, explaining its relationship to threads, event loops, RunLoop modes, sources, timers, observers, and the underlying Mach message mechanisms, while including original source code excerpts for reference.
CoreFoundationMachRunLoop
0 likes · 30 min read

This article explains how iOS RunLoop can be leveraged for thread keep‑alive, controlled termination, lazy image loading, various lag‑detection techniques, crash protection strategies, and demonstrates its integration within the open‑source Matrix framework, providing concrete Swift and Objective‑C code examples.
Objective-C++Performance MonitoringRunLoop
0 likes · 18 min read

This article explains the definitions, causes, and monitoring strategies for iOS app freezes and lags, describes the Heimdallr solution based on Runloop event callbacks, discusses ANR and WatchDog handling, and presents practical optimizations and lessons learned for reliable performance monitoring.
ANRHeimdallrRunLoop
0 likes · 13 min read

The article describes an iOS lag‑monitoring system that detects main‑thread RunLoop blocks, samples stacks every 50 ms into a circular buffer, uses an annealing Fibonacci‑based interval to minimize overhead, visualizes hot paths with flame graphs, and streams data through a Flink‑APM pipeline with only ~2 % CPU and a few megabytes of memory impact.
Flame GraphLag MonitoringRunLoop
0 likes · 12 min read

The article describes an iOS lag‑monitoring system that uses RunLoop state checks to detect main‑thread stalls, captures and caches stack traces, employs a Fibonacci‑based annealing algorithm to limit overhead, symbolises addresses on a server, and visualises results with flame graphs while maintaining low CPU and memory impact.
Flame GraphLag MonitoringRunLoop
0 likes · 13 min read

This article investigates a deadlock between the Main Thread and the JavaScriptCore Heap Collector Thread on iOS 13, explains the underlying mutex and RunLoop interactions, reproduces the issue with CFTimer‑based timers, and proposes an AutoReleasePool‑wrapped solution along with best‑practice recommendations for JavaScriptCore usage.
DeadlockMemory ManagementRunLoop
0 likes · 17 min read

An in‑depth analysis reveals how a Main Thread and JavaScriptCore Heap Collector Thread can deadlock on iOS 13 due to RunLoop lock contention triggered by timer callbacks and AutoReleasePool memory reclamation, and provides a practical solution using scoped AutoReleasePool blocks to prevent the issue.
DeadlockRunLoopTimer
0 likes · 18 min read

This article explores how UIKit, CoreAnimation, CALayer, and CoreFoundation (including RunLoop) collaborate to perform static drawing and animation on iOS, illustrating the process with a button‑drawing example and detailed code snippets.
CoreAnimationRenderingRunLoop
0 likes · 17 min read

This article explains how CADisplayLink registers VSync signals via a mach port, how RunLoop sources and observers process those signals, the impact of adding multiple display links, and the role of CATransaction in committing layer updates and driving iOS UI animation.
CADisplayLinkCoreAnimationRunLoop
0 likes · 12 min read

This article explains the iOS RunLoop mechanism, its role in keeping apps responsive, how it interacts with UIApplicationMain, timers, thread management, and various RunLoop modes, and provides practical examples for using RunLoop to maintain thread life cycles and improve UI performance.
NSTimerRunLoopThread Management
0 likes · 10 min read

This article explains what a RunLoop is, why it exists, its internal structure and modes, how it interacts with threads, and common iOS development techniques such as keeping threads alive, image loading, timer handling, and performance monitoring.
Objective-C++RunLoopThread
0 likes · 11 min read

This article explains how to monitor iOS main‑thread lag using RunLoop observers and the QiLagMonitor tool, detailing RunLoop modes, observer activities, and providing Objective‑C code for creating semaphores, observers, and a background monitoring loop that captures stack traces when the main thread stalls.
Performance MonitoringQiLagMonitorRunLoop
0 likes · 8 min read

This article explains how WeChat’s iOS team built a run‑loop based lag‑monitoring system, describes the causes of main‑thread blockage, the annealing algorithm, time‑consuming stack extraction, crash‑lag detection, and presents performance data showing only a few percent overhead.
RunLoopiOSlag detection
0 likes · 10 min read

This article explains iOS’s event processing pipeline—from hardware events through the RunLoop’s observer, source, timer, and dispatch mechanisms—detailing why UI must run on the main thread, how CALayer and Core Animation render, and the roles of CADisplayLink, NSTimer, and async display techniques.
AsyncDisplayCADisplayLinkRendering
0 likes · 20 min read
