Tagged articles
18 articles
Page 1 of 1
Alibaba Cloud Observability
Alibaba Cloud Observability
Nov 3, 2025 · Mobile Development

Detecting and Diagnosing iOS App Lag with RunLoop Monitoring

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.

Mobile DevelopmentRunLoopiOS
0 likes · 13 min read
Detecting and Diagnosing iOS App Lag with RunLoop Monitoring
Sohu Smart Platform Tech Team
Sohu Smart Platform Tech Team
Aug 9, 2025 · Mobile Development

Mastering iOS Timers: CADisplayLink, NSTimer, RunLoop and Memory‑Leak Solutions Explained

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
Mastering iOS Timers: CADisplayLink, NSTimer, RunLoop and Memory‑Leak Solutions Explained
Tencent Music Tech Team
Tencent Music Tech Team
Oct 20, 2023 · Mobile Development

Root Cause Analysis of OOM Crash in iOS Karaoke App Caused by Swizzled NSMutableArray Protection

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.

AutoreleasePoolOOMObjective‑C
0 likes · 21 min read
Root Cause Analysis of OOM Crash in iOS Karaoke App Caused by Swizzled NSMutableArray Protection
Sohu Tech Products
Sohu Tech Products
Jun 14, 2023 · Mobile Development

Understanding CADisplayLink, NSTimer, and RunLoop in iOS: Implementation, Issues, and Solutions

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.

CADisplayLinkMobile DevelopmentNSTimer
0 likes · 24 min read
Understanding CADisplayLink, NSTimer, and RunLoop in iOS: Implementation, Issues, and Solutions
Sohu Tech Products
Sohu Tech Products
Jun 8, 2022 · Mobile Development

Understanding iOS RunLoop: Architecture, Modes, and Message Handling

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
Understanding iOS RunLoop: Architecture, Modes, and Message Handling
Sohu Tech Products
Sohu Tech Products
Jun 8, 2022 · Mobile Development

Practical Uses of RunLoop in iOS: Thread Keep‑Alive, Stopping, Lazy Image Loading, Lag Detection, Crash Protection, and Integration in the Matrix Framework

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.

Mobile DevelopmentObjective‑CPerformance Monitoring
0 likes · 18 min read
Practical Uses of RunLoop in iOS: Thread Keep‑Alive, Stopping, Lazy Image Loading, Lag Detection, Crash Protection, and Integration in the Matrix Framework
DeWu Technology
DeWu Technology
Dec 23, 2021 · Mobile Development

iOS Lag Monitoring and Performance Optimization Using RunLoop and Flame Graphs

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.

Lag MonitoringRunLoopflame graph
0 likes · 12 min read
iOS Lag Monitoring and Performance Optimization Using RunLoop and Flame Graphs
DeWu Technology
DeWu Technology
Nov 23, 2021 · Mobile Development

iOS Lag Monitoring and Performance Optimization Using Runloop Detection and Flame Graphs

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.

Lag MonitoringRunLoopflame graph
0 likes · 13 min read
iOS Lag Monitoring and Performance Optimization Using Runloop Detection and Flame Graphs
Kuaishou Tech
Kuaishou Tech
Sep 10, 2021 · Mobile Development

Analyzing and Resolving a Main Thread ↔ JavaScriptCore Heap Collector Thread Deadlock on iOS 13

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.

Memory ManagementRunLoopdeadlock
0 likes · 17 min read
Analyzing and Resolving a Main Thread ↔ JavaScriptCore Heap Collector Thread Deadlock on iOS 13
Kuaishou Frontend Engineering
Kuaishou Frontend Engineering
Sep 10, 2021 · Mobile Development

Main Thread vs JavaScriptCore: iOS 13 Deadlock Explained & Fixed

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.

MobileRunLoopdeadlock
0 likes · 18 min read
Main Thread vs JavaScriptCore: iOS 13 Deadlock Explained & Fixed
Sohu Tech Products
Sohu Tech Products
Mar 17, 2021 · Mobile Development

Understanding CADisplayLink, RunLoop, and CoreAnimation in iOS Rendering

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.

CADisplayLinkCoreAnimationMobile Development
0 likes · 12 min read
Understanding CADisplayLink, RunLoop, and CoreAnimation in iOS Rendering
JD Retail Technology
JD Retail Technology
Mar 30, 2020 · Mobile Development

Understanding iOS RunLoop: Concepts, Functions, and Practical Applications

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.

Mobile DevelopmentNSTimerRunLoop
0 likes · 10 min read
Understanding iOS RunLoop: Concepts, Functions, and Practical Applications
360 Tech Engineering
360 Tech Engineering
Feb 12, 2020 · Mobile Development

iOS Main Thread Lag Monitoring with RunLoop and QiLagMonitor

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
iOS Main Thread Lag Monitoring with RunLoop and QiLagMonitor
WeChat Client Technology Team
WeChat Client Technology Team
Nov 19, 2015 · Mobile Development

Unlocking iOS Event Handling & Rendering: RunLoop, UI Threads, and Core Animation

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
Unlocking iOS Event Handling & Rendering: RunLoop, UI Threads, and Core Animation