目录

Overview

Procedure

[h2]DevEco Studio 6.1.0 Beta1 or Later

After device connection is complete, perform the following steps to carry out memory analysis:

  1. Build the app with symbol information. In the module-level build-profile.json5 file, add the strip field and set it to false. (This setting ensures that the symbol table and debugging information in the .so file of the module are preserved. Without the symbol table and debugging information, function names may be missing in the captured data.)

  2. Create an Allocation analysis task and record related data. For details, see In-depth Capture for Problem Locating. Before recording, click to specify the lane to be recorded. Alternatively, click Open File in the session area to import historical data.

    • During capture, you can click in the upper-left corner of the analysis task window to start memory reclamation.
    • When the garbage collector determines that a block of memory allocated by a program or process of the ARK VM tuning target is no longer reachable, it automatically reclaims that memory. This reduces the risk of program errors and unnecessary memory consumption.
    • Memory: displays the physical memory usage of the current process, calculated as PSS + GL + Graph. PSS is the sum of memory exclusively occupied by the process and the proportionally allocated shared library memory.

      Expand the Memory lane to view PSS breakdown by memory type: ArkTS Heap, Native Heap, GL, Graph, Guard, AnonPage Other, FilePage Other, Dev, Stack, ArkWeb PA, JS Heap, .hap, .so, and .ttf. By default, five sub-lanes are displayed. To display other sub-lanes, click options in the main lane and select them.

      Sub-lane

      Description

      ArkTS Heap

      Memory used by the ArkTS heap.

      Native Heap

      Heap memory allocated using new/malloc and used by the native layer (mainly C/C++ code of the .so libraries on which the app depends).

      GL

      Memory used by the app and RS. For the app, this refers to texture memory; for RS, this includes texture and graphics rendering memory.

      Graph

      DMA memory used by the process (counted per deduplication rules), including DMA buffers directly allocated through APIs and those allocated via allocator_host.

      Guard

      Memory occupied by the protection section.

      AnonPage Other

      Memory occupied by other anonymous pages (not starting with heap, anon:native_heap, or anon:ArkTS heap).

      FilePage Other

      Memory occupied by file-mapped pages not categorized as .so, .db, or .ttf.

      Dev

      Memory occupied by the files prefixed with /dev and loaded by processes.

      Stack

      Stack memory.

      ArkWeb PA

      Added in version 26.0.0.

      Memory allocated via Malloc.

      JS Heap

      Added in version 26.0.0.

      Memory used by the JS heap of the ArkWeb Render process.

      .hap

      Memory occupied by .hap files loaded by processes.

      .so

      Memory occupied by .so dynamic library files loaded by processes.

      .ttf

      Memory occupied by .ttf font files loaded by processes.

    • ArkTS Allocation: displays memory allocation information of ARK VMs. The lane is not displayed by default. To record the lane data, click in the upper-left corner and select ArkTS Allocation. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.
      • This lane will be taken offline. You are advised to use the Snapshot template to analyze ArkTS memory leaks.
      • ArkTS Allocation cannot be recorded concurrently with the following lanes due to significant performance overhead that may cause stuttering or freezing:
        • ArkTS Snapshot
        • All Heap & Anonymous VM
        • All Heap
        • All Anonymous VM
        • System Resources
        • Graphic Memory
        • Native Leaks
    • ArkTS Snapshot: captures ArkTS heap memory snapshots. A snapshot is automatically captured when the recording ends. This lane has been added since DevEco Studio 6.1.0 Release and is not available for recording by default. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.

      Since version 26.0.0, the ArkTS Snapshot lane supports memory object parsing. For details, see Parsing Memory Objects.

    • All Heap & Anonymous VM: displays native memory allocation information, including static statistics, allocation stacks, and native memory consumed by function stacks at each layer. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.

      Click in the toolbar to configure recording settings, as listed in the following table.

      Configuration Item

      Description

      Statistics Mode

      Whether to enable statistics mode for data collection, which is enabled by default. Once enabled, data will be aggregated from the device and returned at intervals specified in Sampling Interval. When disabled (non-statistics mode), data is returned from the device in real time after each memory allocation.

      Sampling Interval

      Interval for data collection. It only needs to be configured in statistics mode, with a configurable range of 1s to 3600s and a default value of 10s.

      Collect Only Unreleased Memory Events

      (Added in version 26.0.0)

      Whether to discard the call stack data of the released memory during recording. This function is enabled by default.

      When this feature is enabled, call stacks of released memory are discarded as much as possible, and only call stacks of unreleased memory are retained. This mode is suitable for locating memory leaks and reducing performance overhead on the target app.

      When this feature is disabled, complete call stacks for memory allocation and deallocation operations are retained to analyze the full lifecycle of memory, such as troubleshooting memory jitter.

      All Heap & Anonymous VM Filter Size

      Minimum memory size to capture.

      The value ranges from 0 to 65535 bytes, and the default size is 1024 bytes.

      Sampling Size

      (Added in DevEco Studio 6.1.1 Release)

      Memory data sampling size with a configurable range from 1 to 1048576 bytes and a default value of 4096 bytes.

      This configuration only takes effect for mmap-type data under the Native Heap and All Anonymous VM lanes.

      Backtrace Mode

      Backtrace mode of the memory allocation stack. Currently, two backtrace modes are available: FP (default) and DWARF. FP backtracking links stack frames via the frame pointer (FP register) to directly traverse the call chain. DWARF backtracking performs stack backtracking based on DWARF debugging information generated by the compiler.

      If you select the FP backtrace mode, you can configure JS Backtrace Depth and Native Backtrace Depth. If you select the DWARF backtrace mode, you can configure Backtrace Depth.

      FP backtracking offers better performance but may fail in certain specific scenarios (for example, when compilation parameters of .so files are controlled). In such cases, try DWARF as an alternative.

      Record JS Stack

      Whether to enable JavaScript backtracking. When this feature is enabled, the system automatically backtracks from the native layer to the JavaScript layer, completing stack stitching from native to JavaScript. This is suitable for scenarios where ArkTS/JavaScript code calls native code.

      In versions earlier than DevEco Studio 6.1.0 Beta2, this feature is disabled by default.

      In DevEco Studio 6.1.0 Beta2 and later versions, this feature is enabled by default.

      JS Backtrace Depth

      JavaScript backtrace depth. The value ranges from 1 to 128 and defaults to 10.

      Native Backtrace Depth

      Native backtrace depth. The value ranges from 5 to 100 and defaults to 10.

      Backtrace Depth

      Backtrace depth. This parameter is available only when Backtrace Mode is set to DWARF. Its value indicates the backtrace depth of both JavaScript and native. The value ranges from 5 to 100 and defaults to 20.

      Sync Backtrace Depth

      (Added in DevEco Studio 6.1.1 Beta1)

      Synchronous backtrace depth. This parameter is available only when Record Async Stack is enabled. Its value indicates the synchronous backtrace depth of both JavaScript and native. The value ranges from 5 to 100 and defaults to 20.

      Record Async Stack

      (Added in DevEco Studio 6.1.1 Beta1)

      Whether to enable asynchronous stack stitching. This feature is disabled by default. This feature can be enabled only when Backtrace Mode is set to FP.

      For versions earlier than 26.0.0, when this feature is enabled, one additional asynchronous stack frame is unwound during asynchronous backtracing, with a maximum asynchronous backtrace depth of 16.

      For 26.0.0 and later versions, you can set the asynchronous stack nesting depth and backtrace depth via Async Nesting Depth and Async Backtrace Depth, respectively.

      Async Nesting Depth

      (Added in version 26.0.0)

      Asynchronous stack nesting depth. The value range is [1, 16], and the recommended range is [3, 10]. The default value is 3.

      This parameter can be configured only when Record Async Stack is enabled.

      Async Backtrace Depth

      (Added in version 26.0.0)

      Asynchronous backtrace depth, which indicates the maximum number of frames displayed in each asynchronous stack. The value range is [1, 256], and the recommended range is [16, 32]. The default value is 16.

      This parameter can be configured only when Record Async Stack is enabled.

      Record Data Range Options

      (Added in DevEco Studio 6.1.0 Release)

      Sampling data range, with available options including Malloc (default), Local Handle, and Global Handle.

      • Malloc: records memory allocations triggered by malloc family functions.
      • Local Handle: manages reference handles (napi_value) for the lifecycle of JS objects. This option is only available for phones and PCs.
      • Global Handle: manages reference handles (napi_ref) for the lifecycle of ArkTS/JS values.
      • If Local Handle is selected, the app will restart upon the first recording during its lifecycle. If the app is forcibly terminated and restarted, it will also restart when you start recording again.
      • A smaller value for the minimum trace memory corresponds to a greater backtrace depth, which may cause DevEco Profiler to lag. Configure this parameter properly based on your actual debugging scenarios.
      • The minimum trace memory setting has no impact on Local Handle and Global Handle.
      • The statistics mode is designed for scenarios where individual memory allocations are not of primary interest, and its focus is on monitoring the app's memory usage changes over an extended period. It merges and aggregates data within a specified sampling interval to reduce the amount of data processed, thereby increasing recording efficiency and duration. Sampling Interval is an approximate value, meaning that statistics will be aggregated as close to this interval as possible, with a deviation of no more than 1s. This deviation does not compromise the correctness of memory allocation data.
      • In statistics mode, the recording duration must be an integer multiple of the sampling interval (Sampling Interval). To leave time for data processing and transmission, stop recording slightly after the target duration. For example, with a 10s sampling interval, stop at 11s+ for a 10s capture, 21s+ for a 20s capture, and so on.
    • All Heap lane: displays the sum of heap data. Expanding the main lane reveals four sub-lanes: Native Heap, ArkTS Heap, JS Heap, and JS Heap(ArkWeb-PA). Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.
      • Native Heap: displays the memory allocation data of Malloc, ArkLocalHandle, and ArkGlobalHandle.
      • ArkTS Heap: displays the memory allocation data of ArkTS objects.
      • JS Heap: displays the memory allocation data of JS objects.
      • JS Heap(ArkWeb-PA): displays the memory allocation data of Malloc in ArkWeb. This sub-lane is added in version 26.0.0.

    • All Anonymous VM: displays the anonymous memory usage distribution. Expanding the main lane reveals four sub-lanes: VM:ION, VM:ASHMem, VM:.so, and VM:others. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.
      • VM:ION: displays DMA memory allocation data.
      • VM:ASHMem: displays anonymous shared memory.
      • VM:.so: displays the memory usage of .so files.
      • VM:others: displays mmap data except ION, ASHMem, and .so.

    • System Resources: displays the system resource usage of the process. This lane is available since DevEco Studio 6.1.0 Beta2. Expanding the main lane reveals two sub-lanes: File Descriptors and Threads. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.
      • File Descriptors: displays the file handle usage of the process.
      • Threads: displays the thread usage of the process.

      For details about the available configuration items during lane recording, see #EN-US_TOPIC_0000002731541423__li1060214731415.

    • Graphic Memory: displays memory allocations related to graphics rendering. The lane is hidden by default. To record data for this lane, click in the upper-left corner and select Graphic Memory. Expanding the main lane reveals three sub-lanes: Vulkan, OpenGL ES, and OpenCL. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.
      • Vulkan: displays GPU_VK memory allocation data.
      • OpenGL ES: displays GPU_GLES memory allocation data.
      • OpenCL: displays GPU_CL memory allocation data.

      For details about the available configuration items during lane recording, see #EN-US_TOPIC_0000002731541423__li1060214731415.

    • Native Leaks: marks memory leak points, excluding leaks with only system stacks and leaks with no call stacks. This lane is available since version 26.0.0. The lane is hidden by default. To record the lane data, click in the upper-left corner and select Native Leaks. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.
      • For details about the available configuration items during lane recording, see #EN-US_TOPIC_0000002731541423__li1060214731415.
      • In version 26.0.0, Statistics Mode and Local Handle cannot be enabled during recording for the Native Leaks lane. Before recording this lane, click in the toolbar to disable Statistics Mode and Local Handle. Otherwise, normal recording will be disrupted.
      • The device system must be API 26.0.0 or later.

  3. Press and hold the left mouse button on the target lane, then drag to select the time period for analysis. You can view statistics of specified memory types within the selected period.

    • Memory lane:
      • Statistics (added since version 26.0.0): displays metrics within the currently selected time period, including the minimum virtual memory area (VMA) count (VMA Count Min), maximum VMA count (VMA Count Max), average VMA count (VMA Count Avg), minimum PSS (PSS Min), maximum PSS (PSS Max), average PSS (PSS Avg), average shared dirty memory (Shared Dirty Avg), average shared clean memory (Shared Clean Avg), average private dirty memory (Private Dirty Avg), average private clean memory (Private Clean Avg), and average swap memory (Swap Avg).
      • Details: displays the total PSS of the app memory at each sampling point, as well as the total memory usage of each memory paging state in the selected period. The displayed metrics include timestamp, total PSS, shared dirty memory, shared clean memory, private dirty memory, private clean memory, swap memory, swap PSS, and number of VMAs.

    • Sub-lanes of Memory: The Details pane displays the total PSS of the lane-specific memory at each sampling point and the actual usage of each memory paging state in the selected period.

      The Graph field represents the size of memory used by the process under the /proc/process_dmabuf_info node.

    • ArkTS Allocation lane:

      For the main lane, the total ArkTS memory used by the selected process is displayed. After you drag to select the time period, the object allocation information of all Ark instances captured in this period is displayed.

      For its sub-lanes, the memory usage of the running object in the selected time period is displayed, including the level, memory size of the object, memory size associated with the object, and more.

      Objects marked with in the Details pane can be accessed through windows. The released memory in each period is marked in gray, and the unreleased memory is marked in green.

      This lane will be taken offline. You are advised to use the Snapshot template to analyze ArkTS memory leaks.

    • ArkTS Snapshot lane: After you click an object in the Statistics pane, the Native List tab in the right-side More pane displays the native stack information for references to this object instance.

    • For the All Heap & Anonymous VM, All Heap, All Anonymous VM, System Resources, or Graphic Memory lane, the Details panel displays specific memory allocation information, such as static statistics and allocation stacks, after a sub-lane is selected.
      • Statistics: displays the static allocation information in the selected period, including the allocation mode, total allocated memory size, total allocation times, size of unreleased memory, number of unreleased allocations, size of released memory, and number of released allocations. You can click the redirection button on an object to go to the detailed usage/allocation information about the object. Redirection is not supported in statistics mode.
        • The Statistics pane of the System Resources lane does not provide memory size data.
      • Call Trees: displays the memory allocation stack information of the thread, including the function address or symbol, allocation size, proportion, function stack frame type, and build ID of the .so library (Build ID).
        • The Call Trees pane of the System Resources lane does not provide allocation size data.
        • Since version 26.0.0, the build ID of the .so library (Build ID) can be displayed.
        • For versions earlier than 26.0.0, when the statistics mode (Statistics Mode) is disabled and recording is enabled for the ArkTS Snapshot lane, select the All Heap & Anonymous VM, All Heap, or Native Heap sub-lane, then click any stack frame. The More pane displays the call stack with the maximum allocated memory passing through this stack frame, along with the ArkTS object list (ArkTS Object List). Otherwise, after a stack frame is clicked, the More pane displays the call stack with the maximum allocated memory passing through this stack frame.

          For version 26.0.0 and later, regardless of whether the statistics mode is enabled, when recording the ArkTS Snapshot lane, select the All Heap & Anonymous VM, All Heap, or Native Heap sub-lane, then click any stack frame. The More pane displays the call stack with the maximum allocated memory passing through this stack frame, along with the ArkTS object list (ArkTS Object List).

        Click the redirection button in ArkTS Object List to go to the target object node in the ArkTS Snapshot lane.

        In version 26.0.0 or later, click on the left of the Heaviest Stack list in the More pane to export the list data to the local side.

      • Allocations List: displays detailed information about memory allocation, including the start address of the memory block, timestamp, status, size, invoked library, functions of the invoked library, and event type (corresponding to the allocation mode in the Statistics pane). You can select any object, and all libraries and callers related to the object are displayed on the right.
        • For sub-lanes of System Resources, the start address and size of the memory block are not displayed in the Allocations List pane.
        • Allocations List is not available in statistics mode.

    • For the Native Leaks lane, dragging to select or clicking a leak point to display details about that leak point, including the name of the native leaked object, total count after clustering, total memory size after clustering, type of each stack frame, and memory allocation stack.
      • In statistics mode, Symbol Name does not display thread name information.

  4. (Optional) Based on the analysis result, double-click the call stack that may be defective to go to the related code, and modify the code accordingly.

    Currently, DevEco Profiler does not support redirection to the native code on the user side for a release app.

[h2]Versions Earlier Than DevEco Studio 6.1.0 Beta1

After device connection is complete, perform the following steps to carry out memory analysis:

  1. Build the app with symbol information. In the module-level build-profile.json5 file, add the strip field and set it to false. (This setting ensures that the symbol table and debugging information in the .so file of the module are preserved. Without the symbol table and debugging information, function names may be missing in the captured data.)

  2. Create an Allocation analysis task, and capture related data. For details, see In-depth Capture for Problem Locating. Alternatively, click Open File in the session area and import historical data. Before starting capture, click to select the lane to capture.

    • In the task analysis window, you can zoom the timeline by holding Ctrl and scrolling the mouse wheel, and pan it by holding Shift and scrolling the mouse wheel. Alternatively, you can zoom the timeline by pressing W or S, and pan it by pressing A or D.
    • You can hover the pointer over any position in the lane and press M to add a single-point marker.
    • You can drag to select a time period and press Shift+M to add a time period marker.
    • In the task analysis window, you can press Ctrl+, to select a single-point marker forward, and press Ctrl+. to select a single-point marker backward.
    • In the task analysis window, you can press Ctrl+[ to select a time period marker forward, and press Ctrl+] to select a time period marker backward.
    • Allocation analysis supports offline symbol parsing. For details, see Offline Symbol Parsing.
    • During capture, you can click in the upper-left corner of the analysis task window to start memory reclamation.
    • When the garbage collector determines that a block of memory allocated by a program or process of the ARK VM tuning target is no longer reachable, it automatically reclaims that memory. This reduces the risk of program errors and unnecessary memory consumption.
    • Memory: displays the physical memory usage of the current process. The following memory types are provided:

      PSS: sum of the memory exclusively occupied by a process and the proportionally allocated memory occupied by shared libraries.

      RSS: sum of the memory exclusively occupied by a process and the memory occupied by related shared libraries.

      USS: memory exclusively occupied by a process.

      By default, only PSS statistics are displayed. To view USS or RSS statistics, select the related data type in the upper-right corner of the Memory lane.

      Expand the Memory lane. The sub-lane displays the memory information of each dimension based on the memory type. The dimensions include ArkTS Heap, Native Heap, GL, Graph, Guard, AnonPage Other, FilePage Other, Dev, Stack, .hap, .so, and .ttf. By default, five sub-lanes are displayed. To display other sub-lanes, click options in the main lane and select them.

      Sub-lane

      Description

      ArkTS Heap

      Memory used by the ArkTS heap.

      Native Heap

      Heap memory allocated using new/malloc and used by the native layer (mainly C/C++ code of the .so libraries on which the app depends).

      GL

      Memory used by the app and RS. For the app, this refers to texture memory; for RS, this includes texture and graphics rendering memory.

      Graph

      DMA memory used by the process (counted per deduplication rules), including DMA buffers directly allocated through APIs and those allocated via allocator_host.

      Guard

      Memory occupied by the protection section.

      AnonPage Other

      Memory occupied by other anonymous pages (not starting with heap, anon:native_heap, or anon:ArkTS heap).

      FilePage Other

      Memory occupied by file-mapped pages not categorized as .so, .db, or .ttf.

      Dev

      Memory occupied by the files prefixed with /dev and loaded by processes.

      Stack

      Stack memory.

      .hap

      Memory occupied by .hap files loaded by processes.

      .so

      Memory occupied by .so dynamic library files loaded by processes.

      .ttf

      Memory occupied by .ttf font files loaded by processes.

    • ArkTS Allocation: displays memory allocation information of ARK VMs. The lane is hidden by default. To record the lane data, click in the upper-left corner and select ArkTS Allocation. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery. This lane will be taken offline. You are advised to use the Snapshot template to analyze ArkTS memory leaks.

      Due to the potential significant performance overhead that could cause lag or freezing issues, simultaneous recording of ArkTS Allocation with Native Allocation or Graphic Memory is currently not supported.

    • Native Allocation: displays native memory allocation information, including static statistics, allocation stacks, native memory consumed by function stacks at each layer, and more. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.
      Click in the toolbar to configure recording settings, as listed in the following table.

      Configuration Item

      Description

      Statistics Mode

      Whether to enable statistics mode for data collection, which is enabled by default. Once enabled, data will be aggregated from the device and returned at intervals specified in Sampling Interval. When disabled (non-statistics mode), data is returned from the device in real time after each memory allocation.

      Sampling Interval

      Interval for data collection. It only needs to be configured in statistics mode, with a configurable range of 1s to 3600s and a default value of 10s.

      Native Allocation Filter Size

      Minimum memory size to capture. The value ranges from 0 to 65535 bytes, and the default size is 1024 bytes.

      Backtrace Mode

      Backtrace mode of the memory allocation stack. Currently, two backtrace modes are available: FP (default) and DWARF. FP backtracking links stack frames via the frame pointer (FP register) to directly traverse the call chain. DWARF backtracking performs stack backtracking based on DWARF debugging information generated by the compiler. FP backtracking offers better performance but may fail in certain specific scenarios (for example, when compilation parameters of .so files are controlled). In such cases, try DWARF as an alternative.

      Record JS Stack

      Whether to enable JavaScript backtracking. When this feature is enabled, the system automatically backtracks from the native layer to the JavaScript layer, completing stack stitching from native to JavaScript. This is suitable for scenarios where ArkTS/JavaScript code calls native code.

      JS Backtrace Depth

      JavaScript backtrace depth. The value ranges from 1 to 128 and defaults to 10.

      Native Backtrace Depth

      Native backtrace depth. The value ranges from 5 to 100 and defaults to 10.

      Backtrace Stack

      Backtrace depth. This parameter is available only when Backtrace Mode is set to DWARF. Its value indicates the backtrace depth of both JavaScript and native. The value ranges from 5 to 100 and defaults to 20.

      • A smaller minimum trace memory and a larger backtrace depth may even cause frame freezing of DevEco Profiler. Configure these parameters based on your project requirements.
      • The statistics mode is designed for scenarios where individual memory allocations are not of primary interest, and its focus is on monitoring the app's memory usage changes over an extended period. It merges and aggregates data within a specified sampling interval to reduce the amount of data processed, thereby increasing recording efficiency and duration. Sampling Interval is an approximate value, meaning that statistics will be aggregated as close to this interval as possible, with a deviation of no more than 1s. This deviation does not compromise the correctness of memory allocation data.
      • In statistics mode, the recording duration must be an integer multiple of the sampling interval (Sampling Interval). To leave time for data processing and transmission, stop recording slightly after the target duration. For example, with a 10s sampling interval, stop at 11s+ for a 10s capture, 21s+ for a 20s capture, and so on.

    • Graphic Memory: displays memory allocations related to graphics rendering. This lane is available since DevEco Studio 6.0.2 Beta1. Due to privacy and security policies, this lane is not available for apps that have been released on AppGallery.

      Expanding the main lane reveals three sub-lanes: Vulkan, OpenGL ES, and OpenCL. The Vulkan sub-lane displays memory allocation data of the GPU_VK type; the OpenGL ES sub-lane displays memory allocation data of the GPU_GLES type; the OpenCL sub-lane displays memory allocation data of the GPU_CL type.

  3. Hold down the left mouse button on a lane and drag the mouse to select a time period. The Details panel displays the memory analysis statistics of the specified type within the period.

    • For the Memory lane:
      • The Details panel of the main lane displays the total PSS of the app memory at each sampling point, as well as the total memory usage of each memory paging state within the selected time range.

      • The Details panel of a sub-lane displays the total PSS of the lane-specific memory at each sampling point and the actual usage of each memory paging state in the selected period.

        The Graph field represents the memory size used by the process under the /proc/process_dmabuf_info node.

    • For the ArkTS Allocation lane, the total ArkTS memory used by the selected process is displayed. After you drag to select the lane, the object allocation information of all Ark instances captured in the period is displayed. After you drag to select a sub-lane, the memory usage of the running object in the period is displayed, including the level, memory size of the object, memory size associated with the object, and more. This lane will be taken offline. You are advised to use the Snapshot template to analyze ArkTS memory leaks.

      Objects marked with in the Details pane can be accessed through windows. The released memory in each period is marked in gray, and the unreleased memory is marked in green.

    • For the Native Allocation or Graphic Memory lane, drag to select a sub-lane to view specific memory allocation details, including static statistics and allocation stacks.
      • Statistics: displays the static allocation information within the selected period, including the allocation mode (Malloc or Mmap), total allocated memory size, total allocation times, size of unreleased memory, number of unreleased allocations, size of released memory, and number of released allocations.

        You can click the redirection button on an object to go to the detailed usage/allocation information about the object. Currently, redirection is not supported in statistics mode.

      • Call Trees: displays the memory allocation stack information of the thread, including the function address or symbol, allocation size, proportion, function stack frame type, and more. Click a stack frame. The More area displays the call stack that has the largest memory related to the stack frame.
      • Allocations List: displays detailed information about memory allocation, including the start address of the memory block, timestamp, status, size, invoked library, functions of the invoked library, event type (corresponding to the allocation mode in the Statistics pane), and more.

        Allocations List is not available in statistics mode.

        You can select any object, and all libraries and callers related to the object are displayed on the right.

  4. (Optional) Based on the analysis result, double-click the call stack that may be defective to go to the related code, and modify the code accordingly.

    Currently, DevEco Profiler does not support redirection to the native code on the user side for a release app.