• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Application Killed Event Overview
2
3<!--Kit: Performance Analysis Kit-->
4<!--Subsystem: HiviewDFX-->
5<!--Owner: @shead-master-->
6<!--Designer: @peterhuangyu-->
7<!--Tester: @gcw_KuLfPSbe-->
8<!--Adviser: @foryourself-->
9
10## Overview
11
12Since API version 20, HiAppEvent provides APIs for subscribing to application killed events.
13
14The killed event refers to a phenomenon that an application is forced to exit by the system. Unlike an application crash, an application killed event is triggered not by an exception in the application's own code, but by the system's resource-management policy.
15
16HiAppEvent APIs for subscribing to application killed events:
17
18- [Subscribing to Application Killed Events (ArkTS)](hiappevent-watcher-app-killed-events-arkts.md)
19- [Subscribing to Application Killed Events (C/C++)](hiappevent-watcher-app-killed-events-ndk.md)
20
21The **params** attribute in the application killed event is described as follows:
22
23## Field Description
24
25### params
26
27
28
29| Name   | Type  | Description                      |
30| ------- | ------ | ------------------------- |
31| time     | number | Event triggering time, in ms.|
32| reason  | string | Killed reason. For details, see [reason](#reason).|
33| foreground | boolean | Whether the application is in the foreground. The value **true** indicates that the application is in the foreground, and the value **false** indicates the opposite.|
34
35### reason
36
37| Type  | Description                      |
38| ------- | ------------------------- |
39| IllegalAudioRendererBySuspend | No proper background task is applied for the application, but a large amount of audio is played in the background.|
40| LowMemoryKill | Low system memory.|
41| OomKiller | The system memory is used up and cannot be allocated.|
42| PowerSaveClean | The device is switched to the power saving mode or emergency mode.|
43| ResourceLeak(AshmemLeak) | The Ashmem memory usage of the application exceeds the threshold.|
44| ResourceLeak(GpuLeak) | The GPU memory usage of the application exceeds the threshold.|
45| ResourceLeak(GpuRsLeak) | The GPU memory usage of the application in the Render Service process exceeds the threshold.|
46| ResourceLeak(IonLeak) | The ION memory usage of the application exceeds the threshold.|
47| RssThresholdKiller | The Resident Size Set (RSS) usage of the application exceeds the threshold.|
48| SwapFull | The swap space of the system is used up.|
49