Tag

RunLoop

0 views collected around this technical thread.

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.

AutoreleasePoolMemory LeakObjective-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

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-CRunLoop
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
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.

CoreFoundationEvent LoopRunLoop
0 likes · 30 min read
Understanding iOS RunLoop: Architecture, Modes, and Message Handling
ByteDance Terminal Technology
ByteDance Terminal Technology
Jan 19, 2022 · Mobile Development

Understanding and Optimizing iOS App Freeze and Lag Monitoring with Heimdallr

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.

ANRHeimdallrMobile Development
0 likes · 13 min read
Understanding and Optimizing iOS App Freeze and Lag Monitoring with Heimdallr
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.

Flame GraphLag MonitoringRunLoop
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.

Flame GraphLag MonitoringRunLoop
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.

JavaScriptCoreMemory ManagementRunLoop
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.

JavaScriptCoreMemory ManagementMobile
0 likes · 18 min read
Main Thread vs JavaScriptCore: iOS 13 Deadlock Explained & Fixed
Tencent Music Tech Team
Tencent Music Tech Team
Jun 11, 2021 · Mobile Development

iOS Crash Interception, Reporting, and Post‑Crash Handling

The article explains how iOS crash interception must comprehensively and stably capture Mach, exception and signal crashes using combined signal‑and‑exception handlers, details stack‑trace symbolication via Mach‑O image lookup, and outlines safe post‑crash processing with a limited run‑loop while avoiding handler conflicts.

Crash HandlingMach ExceptionMobile Development
0 likes · 11 min read
iOS Crash Interception, Reporting, and Post‑Crash Handling
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
Sohu Tech Products
Sohu Tech Products
Mar 17, 2021 · Mobile Development

Understanding the Roles of UIKit, CoreAnimation, and CoreFoundation in iOS Rendering

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.

CoreAnimationMobile DevelopmentRunLoop
0 likes · 17 min read
Understanding the Roles of UIKit, CoreAnimation, and CoreFoundation in iOS Rendering
Sohu Tech Products
Sohu Tech Products
Nov 25, 2020 · Mobile Development

Deep Dive into GCD Dispatch Queues, sync/async Behavior, and RunLoop Interaction on iOS

This article explores the intricacies of Grand Central Dispatch on iOS, debunking common misconceptions about main thread and main queue execution, analyzing the internal handling of synchronous tasks, and demonstrating how run‑loop activation influences queue‑thread relationships through a series of code experiments.

AsyncRunLoopdispatch_queue
0 likes · 14 min read
Deep Dive into GCD Dispatch Queues, sync/async Behavior, and RunLoop Interaction on iOS
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.

Event LoopMobile DevelopmentNSTimer
0 likes · 10 min read
Understanding iOS RunLoop: Concepts, Functions, and Practical Applications
JD Retail Technology
JD Retail Technology
Mar 13, 2020 · Mobile Development

Understanding RunLoop: Overview, Principles, and Practical Usage in iOS

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.

Event HandlingObjective-CRunLoop
0 likes · 11 min read
Understanding RunLoop: Overview, Principles, and Practical Usage in iOS
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.

Mobile DevelopmentQiLagMonitorRunLoop
0 likes · 8 min read
iOS Main Thread Lag Monitoring with RunLoop and QiLagMonitor