diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index d2c84ef6faab83e3ecdfc335e820f10055d708dc..43dc0a8608383ffe0acb304cb1dd95c77fbf2a39 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,47 @@ declare namespace hidebug { */ function getGraphicsMemorySync(): number; + /** + * Graphics memory summary. + * + * @interface GraphicsMemorySummary + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 21 + */ + interface GraphicsMemorySummary { + /** + * GL memory + * + * @type { int } + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 21 + */ + gl: int; + + /** + * Graph memory + * + * @type { int } + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + * @since 21 + */ + graph: int; + } + + /** + * 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. 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?: 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 * .rawheap file. You can use rawheap-translator to convert the generated file into a .heapsnapshot file for parsing. @@ -992,7 +1033,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. *