From a8e7ce1176260a48826e2967eb2688b0823a8cd2 Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Thu, 14 Aug 2025 14:05:21 +0800 Subject: [PATCH 1/2] add interface getGraphicsMemorySummary Signed-off-by: yuhaoqiang --- api/@ohos.hidebug.d.ts | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index 76957f11ca..2bc3e07951 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -955,6 +955,50 @@ declare namespace hidebug { */ function getGraphicsMemorySync(): number; + /** + * Graphics memory summary. + * + * @interface GraphicsMemorySummary + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @atomicservice + * @since 21 + */ + interface GraphicsMemorySummary { + /** + * GL memory + * + * @type { number } + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @atomicservice + * @since 21 + */ + gl: number; + + /** + * Graph memory + * + * @type { number } + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @atomicservice + * @since 21 + */ + graph: number; + } + + /** + * Obtains the size of the GPU memory summary. This API uses a promise to return the result. + * + * @param { number } [interval] If the cache of graphics memory is older than interval (unit: second), than the latest + * graphics memory data will be obtained. The interval value range is 2 seconds to + * 3600 seconds, If interval is an invalid value, the default value is 300 seconds. + * @returns { Promise } Returns the size of the GPU memory summary, in KB. + * @throws { BusinessError } 11400104 - Failed to get the application memory due to a remote exception. + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @atomicservice + * @since 21 + */ + function getGraphicsMemorySummary(interval?: number): Promise; + /** * Dumps the original heap snapshot of the VM for the current thread. The API uses a promise to return the path of the * .rawheap file. You can use rawheap-translator to convert the generated file into a .heapsnapshot file for parsing. -- Gitee From c13226f9331fd40d752180c6662486f0e19c90b1 Mon Sep 17 00:00:00 2001 From: yuhaoqiang Date: Thu, 14 Aug 2025 16:51:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yuhaoqiang Change-Id: I4e22d028629a690ed7a6f835277a1fe5e980c92b Signed-off-by: yuhaoqiang --- api/@ohos.hidebug.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index 2bc3e07951..9c87912108 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -988,7 +988,7 @@ declare namespace hidebug { /** * Obtains the size of the GPU memory summary. This API uses a promise to return the result. * - * @param { number } [interval] If the cache of graphics memory is older than interval (unit: second), than the latest + * @param { number } [interval] If the cache of graphics memory is older than interval (unit: second), the latest * graphics memory data will be obtained. The interval value range is 2 seconds to * 3600 seconds, If interval is an invalid value, the default value is 300 seconds. * @returns { Promise } Returns the size of the GPU memory summary, in KB. -- Gitee