Memory Usage Analysis
Memory analysis helps discover leaks and abnormal usage within Lynx pages and ensures stability. You can use Trace Memory Track and IDE tools, to comprehensively monitor and troubleshoot memory-related performance issues.
Deep analysis with Trace
Basic Page Memory Track (Lynx 3.4 And Later)
Starting from Lynx 3.4, Trace supports Memory Track, which shows Lynx page memory usage trends over time. Each Memory Track represents one Lynx page's memory changes.
Click the Memory Track curve to see the page's total memory usage and the memory used by Element, background scripting engine, main-thread scripting engine, images, and other available categories.
Enhanced Memory Analysis
The complete workflow below is illustrated with Lynx 4.5. Memory data availability depends on the SDK, while the tracks, charts, and capture controls shown here also require a DevTool build that supports these features. The SDK version alone does not guarantee this UI. With an older SDK or DevTool, use the basic page Memory Track above for the available data.
Heap snapshot collection requires Lynx 4.5 or later and currently supports QuickJS only. See Heap Snapshot Collection for supported capture scopes and APIs.
Record Memory And Capture Snapshots
Enable memory data collection in the Lynx Trace panel. For active pages, use the camera button on the right to capture different types of snapshots. Snapshot capture supports only the QuickJS engine.
Read Memory Tracks
The memory tracks show changes in page-instance memory, background scripting (BTS) VM memory, and process physical memory (PSS).
Click a BTS VM memory track to see its memory distribution at that moment, including memory used by each page sharing the VM, residuals from destroyed pages, and common scripts.
Select a BTS VM memory track, or select a time range on it, to view an area chart of the VM's memory usage over that interval and identify pages with high memory usage or residuals.
Click the PSS memory track to see memory usage for each Lynx VM and page at that moment.
Inspect Snapshot Details
Single-click a Snapshot icon on a track to view snapshots captured at different times and follow memory changes across the sequence.
Double-click a Snapshot icon on a track to open its details and analyze JavaScript object lifetimes and reference relationships.
Analyze memory with IDEs
This section briefly introduces how to use Android Studio or Xcode’s built-in tools to debug apps and view performance metrics.
This section introduces how to analyze memory using Xcode.
Analyze (static check)
Choose Product > Analyze or press Shift + Command + B to run automatically. Analyze uses syntax and memory context to find potential issues. It mainly detects four categories:
- Logic errors: dereferencing null pointers, uninitialized variables.
- Memory management errors: e.g., memory leaks.
- Declaration errors: variables never used.
- API call errors: missing libraries or frameworks.
📌 Analyzer makes compiler-driven judgments and is not always accurate. If you see a report, review surrounding code; some cycle references that cause memory leaks cannot be identified by Analyzer. Analyzer makes compiler-driven judgments and is not always accurate. If you see a report, review surrounding code; some cycle references that cause memory leaks cannot be identified by Analyzer.
Leaks (dynamic check)
Xcode > Open Developer Tool > Instruments > Leaks

Choose Leaks, then specify the device and app to debug. In this example, an iPhone SE2 (iOS 14.5) simulator debugs the LynxExample app. Click the start button to check for memory leaks.

After starting, operate in the simulator or on device. If the Leaks window shows issues, jump to the corresponding code to debug. You can pause to inspect memory info shown in the chart. After debugging, you can save the results locally.

If a memory leak appears (example below), set the chart to Call Tree mode, then enable Invert Call Tree at the bottom of the window. Select any leak to jump to source code.

Allocations (detailed allocation)
Xcode > Open Developer Tool > Instruments > Allocations

Similar to Leaks but focuses on detailed memory allocations. The lower list shows per-method memory usage. Check a graph to show a bar chart above. Click an item to view stack trace details; click the right-hand Stack Trace pane to jump into code and inspect allocations.

The code section is highlighted and the allocation ratio is shown.

Performance testing with PerfDog
PerfDog is a third-party tool for checking Android and iOS app performance and is easy to use. After connecting a device and choosing the app to debug, click the red circled plus button at the bottom right to add performance parameters before starting.
After the test, you can save data as a table and view performance parameters such as Jank count. Use the tool’s metrics as simple references to check app performance.











