From 6371e9bebbcbc25c6939c6f70b62590117c9ee4f Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Fri, 11 Jul 2025 16:09:39 +0800 Subject: [PATCH] add interfaces getAppNativeMemInfoAsync and getAppNativeMemInfoWithCache Change-Id: I0fbcf8c1213ebfd8b25e5d7552dd49c2ec7dd453 Signed-off-by: yuhaoqiang --- api/@ohos.hidebug.d.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index cfc769777b..6239c4157b 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -441,6 +441,29 @@ declare namespace hidebug { */ function getAppMemoryLimit(): MemoryLimit; + /** + * Obtains the memory information of the application process asynchronous. This API is implemented + * by reading data from the /proc/{pid}/smaps_rollup and /proc/{pid}/statm node. + * + * @returns { Promise } Returns the memory information of the application process. + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 20 + */ + function getAppNativeMemInfoAsync(): Promise; + + /** + * Obtains the memory information of the application process. This API is implemented by reading data from the + * /proc/{pid}/smaps_rollup and /proc/{pid}/statm node. The application memory cache is refresh every 5 minute. + * It will be force to refresh when input true of forceRefresh parameter. + * + * @param { boolean } [forceRefresh] Whether forceRefresh is required when application memeory cache + * need to refresh. The default value is false. + * @returns { NativeMemInfo } Returns the memory information of the application process. + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 20 + */ + function getAppNativeMemInfoWithCache(forceRefresh?: boolean): NativeMemInfo; + /** * Describes the VM memory information. * -- Gitee