Resource Leak Detection Method, Apparatus, and System

US2017168886A1 · US · A1

Patent metadata
FieldValue
Publication numberUS-2017168886-A1
Application numberUS-201715441837-A
CountryUS
Kind codeA1
Filing dateFeb 24, 2017
Priority dateAug 26, 2014
Publication dateJun 15, 2017
Grant date

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Embodiments of the present disclosure disclose a resource leak detection method, apparatus, and system that includes obtaining a target resource called when target code of a program runs, where the target code is partial code in program code, determining a first storage resource amount occupied by the target resource, determining whether the first storage resource amount occupied by the target resource satisfies a first preset condition, and if the first storage resource amount occupied by the target resource satisfies the first preset condition, determining a storage location of the target code as a resource leak location. In the embodiments of the present disclosure, the target code of the program can be tracked, and further, by means of detection, the storage location of the target code can be determined as the resource leak location.

First claim

Opening claim text (preview).

What is claimed is: 1 . A resource leak detection method, comprising: obtaining a target resource called when target code of a program runs, wherein the target code is partial code in a program code; determining a first storage resource amount occupied by the target resource; determining whether the first storage resource amount occupied by the target resource satisfies a first preset condition, wherein the first preset condition is set such that the first storage resource amount occupied by the target resource constitutes a resource leak; and determining a storage location of the target code as a resource leak location when the first storage resource amount occupied by the target resource satisfies the first preset condition. 2 . The method according to claim 1 , wherein the target resource comprises at least two target sub-resources, wherein the target sub-resources are partial resources that are called in a process of running the target code and that are in the target resource, and wherein the method further comprises: obtaining a calling path on which the target sub-resource is called when the target code runs; determining a proportion value that the target sub-resource accounts for the first storage resource amount; determining whether the proportion value that the target sub-resource accounts for in the first storage resource amount satisfies a second preset condition, wherein the second preset condition is set such that the proportion value that the target sub-resource accounts for in the first storage resource amount constitutes a resource leak; and determining the calling path, on which the target sub-resource is called, as a resource leak calling path when the proportion value that the target sub-resource accounts for in the first storage resource amount satisfies the second preset condition. 3 . The method according to claim 1 , wherein the first preset condition comprises a first preset threshold or a first preset increase rule, wherein the first preset threshold is set such that the first storage resource amount is greater than a minimum value of the first storage resource amount, which constitutes a resource leak, wherein the first preset increase rule is set such that an increase trend change of the first storage resource amount in a resource period constitutes a resource leak, wherein the resource period is a life cycle in which the target resource occupies storage space, and wherein determining whether the first storage resource amount occupied by the target resource satisfies a first preset condition comprises: determining whether the first storage resource amount occupied by the target resource is greater than the first preset threshold; and determining that the first storage resource amount occupied by the target resource satisfies the first preset condition when the first storage resource amount occupied by the target resource is greater than the first preset threshold. or 4 . The method according to claim 1 , wherein the first preset condition comprises a first preset threshold or a first preset increase rule, wherein the first preset threshold is set such that the first storage resource amount is greater than a minimum value of the first storage resource amount, which constitutes a resource leak, wherein the first preset increase rule is set such that an increase trend change of the first storage resource amount in a resource period constitutes a resource leak, wherein the resource period is a life cycle in which the target resource occupies storage space, and wherein determining whether the first storage resource amount occupied by the target resource satisfies a first preset condition comprises: determining whether the first storage resource amount occupied by the target resource satisfies the first preset increase rule in the resource period; and determining that the first storage resource amount occupied by the target resource satisfies the first preset condition when the first storage resource amount occupied by the target resource satisfies the first preset increase rule in the resource period. 5 . The method according to claim 2 , wherein the second preset condition comprises a second preset threshold or a second preset increase rule, wherein the second preset threshold is set such that a proportion value of the first storage resource amount is greater than a minimum value of the proportion value that the target sub-resource accounts for in the first storage resource amount, which constitutes a resource leak, wherein the second preset increase rule is set such that an increase trend change of the proportion value that the target sub-resource accounts for in the first storage resource amount in a resource period constitutes a resource leak, wherein the resource period is a life cycle in which the target resource occupies storage space, and wherein determining whether the proportion value that the target sub-resource accounts for in the first storage resource amount satisfies a second preset condition comprises: determining whether the proportion value that the target sub-resource accounts for in the first storage resource amount is greater than the second preset threshold; and determining that the proportion value that the target sub-resource accounts for in the first storage resource amount satisfies the second preset condition if the proportion value that the target sub-resource accounts for in the first storage resource amount is greater than the second preset threshold. 6 . The method according to claim 2 , wherein the second preset condition comprises a second preset threshold or a second preset increase rule, wherein the second preset threshold is set such that a proportion value of the first storage resource amount is greater than a minimum value of the proportion value that the target sub-resource accounts for in the first storage resource amount, which constitutes a resource leak, wherein the second preset increase rule is set such that an increase trend change of the proportion value that the target sub-resource accounts for in the first storage resource amount in a resource period constitutes a resource leak, wherein the resource period is a life cycle in which the target resource occupies storage space, and wherein determining whether the proportion value that the target sub-resource accounts for in the first storage resource amount satisfies a second preset condition comprises: determining whether the proportion value that the target sub-resource accounts for in the first storage resource amount satisfies the second preset increase rule in the resource period; and determining that the proportion value that the target sub-resource accounts for in the first storage resource amount satisfies the second preset condition when the proportion value that the target sub-resource accounts for in the first storage resource amount satisfies the second preset increase rule in the resource period. 7 . The method according to claim 1 , wherein the storage location of the target code comprises at least two storage location units, wherein each of the storage location units stores sub-code, wherein the sub-code stored in the at least two storage location units constitutes the target code, and wherein the method further comprises: obtaining a target sub-resource called when the sub-code stored in the storage location unit runs, wherein target sub-resources called when the sub-code stored in the at least two storage location units runs constitute the target resource; determining a proportion value that the target sub-resource accounts for in the first storage resource amount, wherein the target sub-resource is called when the sub-code stored in the storage location unit runs; determining whether the proportion value satisfies a third

Assignees

Inventors

Classifications

  • by runtime analysis (performance monitoring G06F11/3466) · CPC title

  • Prevention of errors by analysis, debugging or testing of software · CPC title

  • where the computing system component is a memory, e.g. virtual memory, cache (accessing, addressing or allocating within memory systems or architectures G06F12/00; checking stores for correct operation G11C29/00) · CPC title

  • in a memory management context, e.g. virtual memory or cache management (memory management G06F12/00; testing of static memory units G11C29/00) · CPC title

  • G06F11/079Primary

    Root cause analysis, i.e. error or fault diagnosis (in a hardware test environment G06F11/22; in a software test environment G06F11/36) · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US2017168886A1 cover?
Embodiments of the present disclosure disclose a resource leak detection method, apparatus, and system that includes obtaining a target resource called when target code of a program runs, where the target code is partial code in program code, determining a first storage resource amount occupied by the target resource, determining whether the first storage resource amount occupied by the target …
Who is the assignee on this patent?
Huawei Tech Co Ltd
What technology area does this patent fall under?
Primary CPC classification G06F11/3612. Mapped technology areas include Physics.
When was this patent published?
Publication date Thu Jun 15 2017 00:00:00 GMT+0000 (Coordinated Universal Time) (A1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).