From 42b0b1a64ca2cf9b4bf19c05f90bf49ac7f17637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B5=B7=E9=94=8B?= Date: Sat, 26 Jul 2025 14:27:02 +0800 Subject: [PATCH 1/6] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周海锋 --- api/@ohos.hidebug.d.ts | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index d2c84ef6fa..809e506079 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -832,7 +832,7 @@ declare namespace hidebug { /** * Sets the number of FDs, number of threads, JS memory, or native memory limit of the application. - * + * * @param { string } type - resource type. It could be pss_memory、js_heap、fd、or thread. * @param { int } value - For different resource type, values could have different meaning: * 1.For pss_memory, it means the baseline PSS memory size for the application, @@ -886,6 +886,28 @@ declare namespace hidebug { */ function getGraphicsMemorySync(): number; + /** + * Describes the key-value pair used to store graphics memory. This type does not support multi-thread operations. + * If this type is operated by multiple threads at the same time in an application, use a lock for it. + * + * @typedef { Record } GraphicsMemorySummary + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @atomicservice + * @since 21 + */ + type GraphicsMemorySummary = Record; + + /** + * Obtains the size of the GPU memory. This API uses a promise to return the result. + * + * @returns { Promise } Returns the size of the GPU memory, 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(): 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. @@ -992,7 +1014,7 @@ declare namespace hidebug { * On top of level 1 trimming, object address size has been additionally trimmed. * Please use latest version of rawheap-translator tool for parsing and converting * .rawheap into .heapsnapshot file. Conversion process may fail when legacy tool is utilized. - * + * * A higher trimming level means a longer time needed to generate the .rawheap file. * Ensure that this duration falls below the app freeze threshold. * -- Gitee From d4c392c15b05551dd6a4fb6b80e921b96dbc8402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B5=B7=E9=94=8B?= Date: Sat, 26 Jul 2025 15:25:23 +0800 Subject: [PATCH 2/6] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周海锋 --- api/@ohos.hidebug.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index 809e506079..e82f936862 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -900,13 +900,15 @@ declare namespace hidebug { /** * Obtains the size of the GPU memory. This API uses a promise to return the result. * - * @returns { Promise } Returns the size of the GPU memory, in KB. + * @param { boolean } [forceRefresh] Whether to retrieve fresh data and immediate refresh the cached value. + * The default value is false. + * @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(): Promise; + function getGraphicsMemorySummary(forceRefresh?: boolean): Promise; /** * Dumps the original heap snapshot of the VM for the current thread. The API uses a promise to return the path of the -- Gitee From 8f6bf37ab478c53614ff46a475c137054c1ad751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B5=B7=E9=94=8B?= Date: Mon, 28 Jul 2025 16:14:18 +0800 Subject: [PATCH 3/6] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周海锋 --- api/@ohos.hidebug.d.ts | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index e82f936862..6a3aa84454 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -887,28 +887,44 @@ declare namespace hidebug { function getGraphicsMemorySync(): number; /** - * Describes the key-value pair used to store graphics memory. This type does not support multi-thread operations. - * If this type is operated by multiple threads at the same time in an application, use a lock for it. + * Graphics memory summary. * - * @typedef { Record } GraphicsMemorySummary + * @interface GraphicsMemorySummary * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @atomicservice * @since 21 */ - type GraphicsMemorySummary = Record; + interface GraphicsMemorySummary { + /** + * GL memory + * + * @type { int } + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 20 + */ + gl: int; + + /** + * Graphic memory + * + * @type { int } + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 20 + */ + graphic: int; + } /** - * Obtains the size of the GPU memory. This API uses a promise to return the result. + * Obtains the size of the GPU memory summary. This API uses a promise to return the result. * - * @param { boolean } [forceRefresh] Whether to retrieve fresh data and immediate refresh the cached value. - * The default value is false. + * @param { boolean } [interval] If the cache of graphic is older than interval (unit: second), than the latest + * graphics memory data will be obtained. * @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(forceRefresh?: boolean): Promise; + function getGraphicsMemorySummary(interval?: int): Promise; /** * Dumps the original heap snapshot of the VM for the current thread. The API uses a promise to return the path of the -- Gitee From 8c38dca84a565ec88c06b0c44cfbacfb7b888696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B5=B7=E9=94=8B?= Date: Mon, 28 Jul 2025 16:31:33 +0800 Subject: [PATCH 4/6] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周海锋 --- api/@ohos.hidebug.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index 6a3aa84454..f16faf6349 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -904,20 +904,20 @@ declare namespace hidebug { gl: int; /** - * Graphic memory + * Graph memory * * @type { int } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug * @since 20 */ - graphic: int; + graph: int; } /** * Obtains the size of the GPU memory summary. This API uses a promise to return the result. * - * @param { boolean } [interval] If the cache of graphic is older than interval (unit: second), than the latest - * graphics memory data will be obtained. + * @param { int } [interval] If the cache of graphics memory is older than interval (unit: second), than the latest + * graphics memory data will be obtained. * @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 -- Gitee From 458d084f3bca9a9962eb747b950d8d72d0bb05c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B5=B7=E9=94=8B?= Date: Mon, 28 Jul 2025 16:34:34 +0800 Subject: [PATCH 5/6] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周海锋 --- api/@ohos.hidebug.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index f16faf6349..e12ed5d37f 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -899,7 +899,7 @@ declare namespace hidebug { * * @type { int } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 + * @since 21 */ gl: int; @@ -908,7 +908,7 @@ declare namespace hidebug { * * @type { int } * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug - * @since 20 + * @since 21 */ graph: int; } -- Gitee From 84ac19ee490238817bfe5d70cc2b5967f4f234a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=B5=B7=E9=94=8B?= Date: Wed, 6 Aug 2025 15:49:48 +0800 Subject: [PATCH 6/6] =?UTF-8?q?HiDebug=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E5=BD=A2=E5=86=85=E5=AD=98=E6=A6=82=E8=A6=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周海锋 --- api/@ohos.hidebug.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index e12ed5d37f..43dc0a8608 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -917,7 +917,8 @@ declare namespace hidebug { * Obtains the size of the GPU memory summary. This API uses a promise to return the result. * * @param { int } [interval] If the cache of graphics memory is older than interval (unit: second), than the latest - * graphics memory data will be obtained. + * 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 -- Gitee