1# ArkCompiler Subsystem Changelog 2 3## cl.arkcompiler.1 Changed the File Format of Heap Dump Products In the Case of OOM Errors 4 5**Access Level** 6 7Other 8 9**Reason for Change** 10 11To 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: 12 131. The online parsing logic of heap dump is removed, and the product format is changed from .heapsnapshot to .rawheap. 14 152. The rawheap_translator tool integrated in the SDK provides the feature of parsing .rawheap files and generating .heapsnapshot files. 16 17**Change Impact** 18 19This change is a non-compatible change. 20 21Before change: In the case of an OOM error, the dump file generated by heap dump is in .heapsnapshot format. 22 23After 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. 24 25**Start API Level** 26 2711 28 29**Change Since** 30 31OpenHarmony SDK 5.0.0.56 32 33**Key API/Component Changes** 34 35The rawheap_translator tool is added to the **toolchains** directory of the OpenHarmony SDK. 36 37**Adaptation Guide** 38 39Use the rawheap_translator tool to convert .rawheap files generated by heap dump during OOM into .heapsnapshot files. 40 41How To Obtain 42 43The rawheap_translator tool is compatible with OHOS, Windows, Linux, and macOS. 44 45The tool compatible with OHOS is stored in **/bin/rawheap_translator** and can be directly called on the device. 46 47For Windows, Linux, and macOS, the compatible tool is in **/toolchains/rawheap_translator** of the SDK. 48 49Environment Variables 50 51Set the environment variables in Windows as follows: 52 53Right-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. 54 55Set the environment variables in macOS as follows: 56 57Open the terminal tool and run the following command: 58 59``` 60echo $SHELL 61``` 62 63The 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: 64 65``` 66vi ~/.bash_profile 67``` 68 69Press **i** to enter the editing mode and run the following command: 70 71``` 72export PATH=$PATH:<rawheap_translator path>; 73``` 74 75Press **Esc** to exit the edit mode. Then enter **:wq** and press **Enter** to save the settings. 76 77Run the following command for the environment variable to take effect. 78 79``` 80source ~/.bash_profile 81``` 82 83After the configuration, restart the PC. 84 85Usage 86 87Command for invoking the tool: 88 89``` 90rawheap_translator <rawheap_file> 91 92rawheap_translator <rawheap_file> <heapsnapshot_file> 93``` 94 95Parameter description: 96 97| Parameter| Description| Example| 98| - | - | - | 99| <rawheap_file> | 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**.| 100| <heapsnapshot_file> | 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**.| 101