harmony 鸿蒙ArkCompiler Subsystem Changelog

  • 2025-06-12
  • 浏览 (25)

ArkCompiler Subsystem Changelog

cl.arkcompiler.1 Changed the File Format of Heap Dump Products In the Case of OOM Errors

Access Level

Other

Reason for Change

To improve the probability and efficiency of generating dump files by heap dump when an application experiences an OOM error, and help developers locate memory leakage problems, the following changes are made:

  1. The online parsing logic of heap dump is removed, and the product format is changed from .heapsnapshot to .rawheap.

  2. The rawheap_translator tool integrated in the SDK provides the feature of parsing .rawheap files and generating .heapsnapshot files.

Change Impact

This change is a non-compatible change.

Before change: In the case of an OOM error, the dump file generated by heap dump is in .heapsnapshot format.

After change: In the case of an OOM error, the dump file generated by heap dump is in .rawheap format. The rawheap_translator tool needs to be called to convert the .rawheap file into a .heapsnapshot file.

Start API Level

11

Change Since

OpenHarmony SDK 5.0.0.56

Key API/Component Changes

The rawheap_translator tool is added to the toolchains directory of the OpenHarmony SDK.

Adaptation Guide

Use the rawheap_translator tool to convert .rawheap files generated by heap dump during OOM into .heapsnapshot files.

How To Obtain

The rawheap_translator tool is compatible with OHOS, Windows, Linux, and macOS.

The tool compatible with OHOS is stored in /bin/rawheap_translator and can be directly called on the device.

For Windows, Linux, and macOS, the compatible tool is in /toolchains/rawheap_translator of the SDK.

Environment Variables

Set the environment variables in Windows as follows:

Right-click This PC, choose Properties > Advanced System Settings > Advanced > Environment Variables > Path, click Edit, and add the path of rawheap_translator.exe to Path. After the configuration, restart the PC.

Set the environment variables in macOS as follows:

Open the terminal tool and run the following command:

echo $SHELL

The command output may be /bin/bash or /bin/zsh. The following uses /bin/bash as an example. Run the following commands to open the .bash_profile file:

vi ~/.bash_profile

Press i to enter the editing mode and run the following command:

export PATH=$PATH:<rawheap_translator path>;

Press Esc to exit the edit mode. Then enter :wq and press Enter to save the settings.

Run the following command for the environment variable to take effect.

source ~/.bash_profile

After the configuration, restart the PC.

Usage

Command for invoking the tool:

rawheap_translator <rawheap_file>

rawheap_translator <rawheap_file> <heapsnapshot_file>

Parameter description:

|Parameter|Description|Example| |-|-|-| ||Path of the .rawheap file generated by heap dump in the case of OOM errors, for example, /data/log/reliability/resource_leak/memory_leak.|To parse the example.rawheap file in D:\temp\rawheap: rawheap_translator D:\temp\example.rawheap, run the following command: rawheap_translator D:\temp\example.rawheap.| ||Path and name of the file generated after parsing. The file name extension must be heapsnapshot. If this parameter is not specified, the current path is used by default, and the file name is automatically generated.|To parse the example.rawheap file in the D:\temp\rawheap directory and generate the result file result.heapsnapshot in the D:\temp\result directory, run the following command: rawheap_translator D:\temp\example.rawheap D:\temp\result\result.heapsnapshot.|

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Framework Changelog

harmony 鸿蒙Multimedia Subsystem Changelog

harmony 鸿蒙Window Subsystem Changelog

0  赞