openharmony 鸿蒙 hiappevent-watcher-resourceleak-events

2025-06-12 浏览 (1)

Resource Leak Event Overview

HiAppEvent provides APIs for subscribing to system resource leak events of the system.

The params parameter in the event information is described as follows.

params

NameTypeDescription
timenumberEvent triggering time, in ms.
bundle_versionstringApplication version.
bundle_namestringApplication name.
pidnumberProcess ID of the application.
uidnumberUser ID of the application.
resource_typestringResource type. For details, see resource_type.
memoryobjectMemory information (only available for pss_memory and js_heap). For details, see memory.
fdobjectFile descriptor information (only available for fd). For details, see fd.
threadobjectThread information (only available for thread). For details, see thread.
external_logstring[]Path of the error log file. If the directory files exceed the threshold (for details, see log_over_limit), new log files may fail to be written. Therefore, delete the log files immediately after they are processed.
log_over_limitBooleanWhether the size of generated fault log files and existing log files exceeds the upper limit (2 GB). The value true indicates that the upper limit is exceeded and logs fail to be written. The value false indicates that the upper limit is not exceeded.

resource_type

ValueDescription
pss_memoryPSS memory leak.
js_heapJS memory leak.
fdFD resource leak.
threadThread leak.

memory

NameTypeDescription
rssnumberSize of the memory allocated for a process (only available for pss_memory), in KB.
vssnumberSize of the virtual memory applied by a process from the system (only available for pss_memory), in KB.
pssnumberSize of the physical memory actually used by a process (only available for pss_memory), in KB.
sys_free_memnumberSize of free memory (only available for pss_memory), in KB.
sys_avail_memnumberSize of available memory (only available for pss_memory), in KB.
sys_total_memnumberTotal memory size (only available for pss_memory), in KB.
limit_sizenumberLimit of memory size (only available for js_heap), in KB.
live_object_sizenumberSize of the used memory (only available for js_heap), in KB.

fd

NameTypeDescription
numnumberTotal number of FDs.
top_fd_typestringFD with the largest number.
top_fd_numnumberNumber of top_fd_type.

thread

NameTypeDescription
numnumberTotal number of threads.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Performance Analysis Kit

harmony 鸿蒙Analyzing Application Freeze

harmony 鸿蒙Development of Application Recovery

harmony 鸿蒙Analyzing C++ Crash

harmony 鸿蒙Development of Error Manager

harmony 鸿蒙hdc

harmony 鸿蒙Event Reporting

harmony 鸿蒙Introduction to HiAppEvent

harmony 鸿蒙Subscribing to Address Sanitizer Events (ArkTS)

harmony 鸿蒙Subscribing to Address Sanitizer Events (C/C++)

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/QpKipY