How Matrix for iOS/macOS Boosts App Performance with Crash and Memory Monitoring
Matrix for iOS/macOS is an open‑source performance probing tool from the WeChat team that monitors crashes, jank, and memory issues on iOS and macOS, offering plugins for detailed stack capture and out‑of‑memory reporting, with future plans for power‑consumption tracking and cloud integration.
Matrix for iOS/macOS is a performance probing tool developed by the WeChat team, integrated into the iOS and macOS WeChat APM platform. It provides a unified performance access framework for iOS and macOS, collecting abnormal data to help developers improve app quality and user experience.
The project is open‑sourced at https://github.com/tencent/matrix/tree/master/matrix/matrix-iOS and welcomes stars, issues and pull requests.
Features of Matrix for iOS/macOS
The current monitoring scope includes crashes, jank, and memory spikes, implemented via two plugins:
WCCrashBlockMonitorPlugin
WCMemoryStatPlugin
WCCrashBlockMonitorPlugin
Built on the KSCrash framework, this plugin captures jank stacks with industry‑leading capability. It detects jank by inspecting the RunLoop state on both iOS and macOS, and extracts the most time‑consuming main‑thread stack. It also inherits KSCrash’s crash‑capture functionality.
WCMemoryStatPlugin
A highly optimized memory monitoring tool that records stack traces and allocation details when an app experiences out‑of‑memory crashes. Compared with existing tools, it offers superior performance and comprehensive coverage. Its features include:
Collecting object lifetimes and corresponding stacks during runtime, reporting when OOM is detected.
Storing live objects in a balanced binary tree and stacks in a hash table for maximal efficiency.
Future Plans
Extend jank monitoring to capture power‑consumption stacks.
Develop a complete cloud‑based solution.
Open‑Source Repository
Project homepage: https://github.com/tencent/matrix
Stars, issues and pull requests are welcome.
WeChat Client Technology Team
Official account of the WeChat mobile client development team, sharing development experience, cutting‑edge tech, and little‑known stories across Android, iOS, macOS, Windows Phone, and Windows.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
