US20130145220A1 - Detection on Resource Leakage - Google Patents

Detection on Resource Leakage Download PDF

Info

Publication number
US20130145220A1
US20130145220A1 US13/814,045 US201113814045A US2013145220A1 US 20130145220 A1 US20130145220 A1 US 20130145220A1 US 201113814045 A US201113814045 A US 201113814045A US 2013145220 A1 US2013145220 A1 US 2013145220A1
Authority
US
United States
Prior art keywords
samples
computing system
resource
increase
time series
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
US13/814,045
Inventor
Peng LV
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Telefonaktiebolaget LM Ericsson AB
Original Assignee
Telefonaktiebolaget LM Ericsson AB
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Telefonaktiebolaget LM Ericsson AB filed Critical Telefonaktiebolaget LM Ericsson AB
Assigned to TELEFONAKTIEBOLAGET L M ERICSSON (PUBL) reassignment TELEFONAKTIEBOLAGET L M ERICSSON (PUBL) ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: LV, PENG
Publication of US20130145220A1 publication Critical patent/US20130145220A1/en
Abandoned legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/073Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/076Error or fault detection not based on redundancy by exceeding limits by exceeding a count or rate limit, e.g. word- or bit count limit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • G06F11/3072Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment

Definitions

  • the present invention generally relates to resource management in a computing system. More specifically, and in various embodiments, the present invention relates to a method, an arrangement, a computer program product, and a computer readable medium for detecting a resource leakage in a computing system.
  • a memory leak (or leakage, in this context) occurs when a computer program consumes memory but is unable to release it back to the operating system. It can diminish the performance of the computer by reducing the amount of available memory. Eventually, in the worst case, too much of the available memory may become allocated and all or part of the system or device stops working, the application fails, or the system slows down unacceptably due to thrashing.
  • FIG. 1 shows a schematic process for detecting a memory leakage in a computer. As shown in FIG. 1 , at step S 110 , the current memory usage of the computer is measured.
  • step S 120 if it is determined that the measured usage is greater than a predetermined threshold TH 1 , proceeding to step S 130 , where the occurrence of the leakage is reported to the operation system; otherwise, the process continues with step S 140 , where a predetermined interval elapses and afterwards the process returns to step S 120 .
  • the method fails to consider the fact that the memory usage is usually proportional to the service load of a system, and thus in some circumstances, the prominent peak of the memory usage above the threshold does not suggest a memory leak but merely a high load. Once the load drops, the memory usage will return its normal level. Furthermore, an abrupt leakage may cause the memory exhausted in a short period and with this method, if the threshold TH 1 is improperly set as a high value, there may has no sufficient time to warn in advance until the memory capacity is totally unavailable.
  • aspects of the invention include a method for detecting a resource leakage in a computing system.
  • the method may comprise the following steps: obtaining a usage concerning a resource in the computing system, which represents one of samples in a time series; determining whether the samples tend to increase; and reporting occurrence of the resource leakage in the computing system if it is determined that the samples tend to increase.
  • the determining step if there exists a set of ascending samples in the time series, it is determined that the samples tend to increase. More preferably, in the determining step, the set of ascending samples is characterized as follows:
  • k is the number of elements in the set of the ascending samples
  • S i is the i th element in the set of the ascending samples
  • m x and m y are the x th and the y th samples in the time series.
  • the samples are obtained by measuring the usage periodically.
  • the resource is memory or file descriptors available for the whole computing system, an application or a process.
  • Another aspects of the present invention includes an arrangement for detecting a resource leakage in a computing system.
  • the arrangement comprises: a first unit for obtaining a usage concerning a resource in the computing system, which represents one of samples in a time series; a second unit for determining whether the samples obtained by the first unit tend to increase; and a third unit for reporting occurrence of the resource leakage in the computing system if the second unit determines that the samples tend to increase.
  • FIG. 1 shows a schematic process for detecting a memory leakage in a computer.
  • FIG. 2 is a flowchart illustrating method steps for memory leakage detection according to one exemplary embodiment of the present invention.
  • FIG. 3 is a flowchart illustrating method steps for memory leakage detection according to one exemplary embodiment of the present invention.
  • FIG. 4 is a flowchart illustrating an exemplary algorithm for searching for the set of the ascending samples from the time series.
  • FIG. 5 shows a simulation diagram obtained by means of the algorithm of FIG. 4 .
  • FIG. 6 is a block diagram illustrating one embodiment of an arrangement for detecting a memory leakage according to the present invention.
  • the methods and arrangements of the present invention are illustrated by being used in the memory leakage scenario.
  • the present invention can be applied to other kinds of resources, which are limited in terms of their amounts or usage and cannot be reused partially or completely due to errors or faults.
  • one kind of the resources can be file descriptors, which are assigned to each process or task in a UNIX-like operation system and if not properly released, the process will suffer core-dump consequently.
  • Other kinds of such resources include but are not limited to computing capability and communication channels.
  • resource usage is periodically or randomly monitored on whether it has a trend to increase or rises steadily, and if such trend exists, it is determined that a resource leakage occurs.
  • This approach may exclude the situation that a peak of the resource usage merely results from a high load during operation.
  • the methods and arrangement can be used in a variety of computing system, e.g., including but not limited to server, personal computer, laptop computer, embedded computer and like. Moreover, the methods can be implemented in form of software, hardware, firmware or the combination thereof.
  • the following embodiments are assumed to be applied to a computing system comprising a processor, a memory, I/O device(s), an operation system, and application(s).
  • the computing system further comprises an arrangement for detecting memory leakage.
  • FIG. 2 is a flowchart illustrating method steps for memory leakage detection according to one exemplary embodiment of the present invention.
  • the arrangement measures or obtains the current memory usage of the computing system.
  • the current value together with the values previously measured, constitute a time series.
  • each of the values can be regarded as one of samples in the time series.
  • the word “measure” herein means that the measuring is performed by either the arrangement itself or other components external to the arrangement, e.g., the underlying functionality or routine provided by the operation system and invoked by the arrangement.
  • step S 220 the arrangement determines whether there is a steady rising among the samples of the time series, i.e., whether the samples tend to increase. If such rising is found, the process proceeds to step S 230 ; otherwise, the process proceeds to step S 240 .
  • step S 230 the arrangement generates a message indicating that a memory leakage occurs and transmits it to the operation system so that appropriate actions will be taken to prohibit the performance of the computing system from being degraded.
  • the arrangement waits for a predetermined interval and then returns to step S 210 .
  • the samples of the time series are measured or obtained periodically.
  • the fixed interval is unnecessarily and indeed, measuring may occur randomly.
  • the arrangement may be configured to initiate a leakage detection process in response to the receipt of a trigger signal, e.g., from the operation system.
  • FIG. 3 is a flowchart illustrating method steps for memory leakage detection according to one exemplary embodiment of the present invention.
  • step 310 the arrangement “listen for” the trigger signal or command from the operation system. If receiving the signal, the process proceeds to step S 320 ; otherwise, the arrangement continues to listen for the signal or command.
  • the arrangement measures or obtains the current memory usage of the computing system to form a time series consisting of the current value and the history values.
  • step S 330 the arrangement determines whether the samples of the time series tends to increase. If such trend is found, the process proceeds to step S 340 ; otherwise, the process proceeds to step S 310 .
  • step S 340 the arrangement generates a message that a memory leakage occurs and transmits the message to the operation system, which, in turn, takes appropriate actions.
  • the memory usage refers to that of the whole computing system.
  • the embodiments as shown in FIGS. 2 and 3 can also be applied to the case where the memory usage of an executing program or a task needs to be monitored. These variation and modification are within the spirit and principle of the present invention.
  • the trend or the steady increase is characterized by the following set of ascending samples:
  • k is the number of elements in the set of the ascending samples
  • S i is the i th element in the set of the ascending samples
  • m x and m y are the x th and the y th samples in the time series.
  • FIG. 4 is a flowchart illustrating an exemplary algorithm for searching for the set of the ascending samples from the time series.
  • a new value for the memory usage is obtained as the current value.
  • the value can be periodically or randomly measured.
  • step S 420 if it is determined that the array for the ascending samples, denoted as S herein, is empty, the procedure proceeds to step S 430 , where the current value m is recorded as the first element S 1 in the array S, and further to step S 410 ; otherwise, proceeding to step S 440 .
  • any element being not less than the current value m is removed from the array S. Subsequently, at step S 450 , the current value is recorded as the tail or last element of the array S, denoted as S j herein.
  • step 460 determines whether the number of the elements in the array S is equal to a predetermined parameter k, i.e., whether there exists a set of ascending samples in the time series. If it is the case, the process proceeds to step S 470 , where the event of the steady rising is reported; otherwise, returning step S 410 .
  • FIG. 5 shows a simulation diagram obtained by means of the algorithm of FIG. 4 .
  • the memory usage is periodically measured at the timings t 1 , t 2 , t 3 , . . . , t 21 , . . . , with a fixed interval T therebetween.
  • the procedure has detected a set of ascending samples:
  • the memory usage increases abruptly, causing a crash in the system under simulation test. If the procedure functions as a detector for memory leakage, the crash can be avoided.
  • the number of the samples k is set as 8. It should be noted that this parameter, along with the interval ⁇ T can be adjusted to adapt to a variety of occasions. For example, it is considerable to adopt ⁇ T having a greater value for a slow memory leak and ⁇ T having a smaller value for a quick memory leak. As for the number of the samples k, it is found that the greater k will improve detection accuracy and reliability but may need more time.
  • the trend to increase in the time series can be detected by searching for the set of ascending samples therein.
  • an algorithm based on moving-average (MA) is used.
  • the memory usage is periodically measured with the interval ⁇ T, whereby generating a time series denoted as (m 1 , m 2 , m 3 , . . . m n , . . . ) herein.
  • the trend or the steady increase is determined based on the change of the moving average of the time series. In particular, if the moving average is greater than a predetermined threshold, it is determined that the time series has a steady increase; otherwise, no steady increase occurs.
  • the moving average may be replaced by its changing rate.
  • the moving average of the time series MA can be updated as follows:
  • m i is the i th sample in the time series
  • h is the number of the samples for averaging.
  • the number of the samples and the threshold are adjustable so as to adapt to a variety of occasions. For example, the number and the threshold at a lower level will result in a prompt response to the memory leakage but risk a false detection. On the other hand, with a higher level for these parameters, accuracy and reliability are anticipated but sensitivity decreases.
  • FIG. 6 is a block diagram illustrating one embodiment of an arrangement for detecting a memory leakage according to the present invention.
  • the arrangement as shown in FIG. 6 may be implemented in form of a software tool for monitoring real memory usage status, which runs on or is integrated with the operating system, a circuitry for specific purpose, e.g., Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), or the combination thereof. It can also be implemented as a standalone tool for debugging memory leak in development phase.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the arrangement 600 comprises a first unit 610 , a second unit 620 and a third unit 630 .
  • the first to third units 610 - 630 can be implemented in form of separate component or module.
  • the first unit 610 is responsible for obtaining or measuring a plurality of samples for the memory usage of the computing system by invoking the routine provided by the operation system. As described above, the samples constitute a time series. Again, the memory usage can be either periodically or randomly measured.
  • the second unit 620 communicates with the first unit 610 and the third unit 630 . It determines whether the samples obtained by the first unit 610 have a trend to increase. If such trend is found, the third unit 630 will report the occurrence of the memory leakage to the operation system. In this embodiment, the second unit 620 can be configured to perform the determination by using the methods as described above.
  • the methods and arrangement herein disclosed in conjunction with FIGS. 2 , 3 , 4 , 5 and 6 , enables an instant, accurate and reliable detection on memory leak to avoid system crash. Particularly, the memory usage peak caused by dynamic service load can be effectively filtered out.
  • the present invention provides a computer program product adapted to carry out the methods as described above when run on a computer.

Abstract

A method for detecting a resource leakage in a computing system is disclosed. The method comprises steps of: obtaining (S210, S320) a usage concerning a resource in the computing system, which represents one of samples in a time series; determining (S220, S330) whether the samples tend to increase; and reporting (S230, S340) occurrence of the resource leakage in the computing system if it is determined that the samples tend to increase. An arrangement (600) for detecting a resource leakage in a computing system is also disclosed.

Description

    TECHNICAL FIELD
  • The present invention generally relates to resource management in a computing system. More specifically, and in various embodiments, the present invention relates to a method, an arrangement, a computer program product, and a computer readable medium for detecting a resource leakage in a computing system.
  • BACKGROUND
  • A memory leak (or leakage, in this context) occurs when a computer program consumes memory but is unable to release it back to the operating system. It can diminish the performance of the computer by reducing the amount of available memory. Eventually, in the worst case, too much of the available memory may become allocated and all or part of the system or device stops working, the application fails, or the system slows down unacceptably due to thrashing.
  • However, it is difficult to have an accurate and timely detection or prediction on memory leaks, especially in a large-scale system, such as telecom software, partially because there will not usually be an immediate symptom when a leakage begins.
  • A variety of methods and technologies have been developed to address the memory leakage issue. For example, a method has been developed in which a fixed threshold of memory usage is set, and if the peak of total memory usage exceeds the fixed threshold, it is determined that the memory is in the memory leak state. FIG. 1 shows a schematic process for detecting a memory leakage in a computer. As shown in FIG. 1, at step S110, the current memory usage of the computer is measured. Then, at step S120, if it is determined that the measured usage is greater than a predetermined threshold TH1, proceeding to step S130, where the occurrence of the leakage is reported to the operation system; otherwise, the process continues with step S140, where a predetermined interval elapses and afterwards the process returns to step S120.
  • The method, however, fails to consider the fact that the memory usage is usually proportional to the service load of a system, and thus in some circumstances, the prominent peak of the memory usage above the threshold does not suggest a memory leak but merely a high load. Once the load drops, the memory usage will return its normal level. Furthermore, an abrupt leakage may cause the memory exhausted in a short period and with this method, if the threshold TH1 is improperly set as a high value, there may has no sufficient time to warn in advance until the memory capacity is totally unavailable.
  • Another approach is to carry out a series of tests for finding potential leaks with debuggers, such as Rational Purify® available from IBM in Armonk, N.Y., U.S.A., in development phase. However, for a large-scale and complex system, it is impossible to enumerate all code branches in the tests, and thus the likelihood of leakage can only be reduced. Additionally, the debugging is a time-consuming process and will significantly extend the development course.
  • SUMMARY OF THE INVENTION
  • It is the object to obviate at least some of the above disadvantages and provide an improved solution for detecting the resource leakage.
  • Aspects of the invention include a method for detecting a resource leakage in a computing system. The method may comprise the following steps: obtaining a usage concerning a resource in the computing system, which represents one of samples in a time series; determining whether the samples tend to increase; and reporting occurrence of the resource leakage in the computing system if it is determined that the samples tend to increase.
  • In a preferred embodiment according to the present invention, in the determining step, if there exists a set of ascending samples in the time series, it is determined that the samples tend to increase. More preferably, in the determining step, the set of ascending samples is characterized as follows:

  • (S 1 , . . . ,S i ,S i+1 , . . . ,S k),S i+1 >S i,1≦i≦k−1

  • S i =m x ,S i+1 =m y ,x<y
  • where k is the number of elements in the set of the ascending samples, Si is the ith element in the set of the ascending samples, mx and my are the xth and the yth samples in the time series.
  • In another preferred embodiment according to the present invention, the samples are obtained by measuring the usage periodically.
  • In another preferred embodiment according to the present invention, the resource is memory or file descriptors available for the whole computing system, an application or a process.
  • Another aspects of the present invention includes an arrangement for detecting a resource leakage in a computing system. The arrangement comprises: a first unit for obtaining a usage concerning a resource in the computing system, which represents one of samples in a time series; a second unit for determining whether the samples obtained by the first unit tend to increase; and a third unit for reporting occurrence of the resource leakage in the computing system if the second unit determines that the samples tend to increase.
  • There also provides a computer program product adapted to carry out the method as described above when run on a computer and a computer readable medium comprising computer executable program code adapted to carry out the steps in the method as described above.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • The foregoing and other objects, features, and advantages of the invention will be apparent from the following more particular description of preferred embodiments as illustrated in the accompanying drawings in which reference characters refer to the same parts throughout the various views.
  • FIG. 1 shows a schematic process for detecting a memory leakage in a computer.
  • FIG. 2 is a flowchart illustrating method steps for memory leakage detection according to one exemplary embodiment of the present invention.
  • FIG. 3 is a flowchart illustrating method steps for memory leakage detection according to one exemplary embodiment of the present invention.
  • FIG. 4 is a flowchart illustrating an exemplary algorithm for searching for the set of the ascending samples from the time series.
  • FIG. 5 shows a simulation diagram obtained by means of the algorithm of FIG. 4.
  • FIG. 6 is a block diagram illustrating one embodiment of an arrangement for detecting a memory leakage according to the present invention.
  • DETAILED DESCRIPTION
  • While the invention covers various modifications and alternative constructions, embodiments of the invention are shown in the drawings and will hereinafter be described in detail. However it should be understood that the specific description and drawings are not intended to limit the invention to the specific forms disclosed. On the contrary, it is intended that the scope of the claimed invention includes all modifications and alternative constructions thereof falling within the scope of the invention as expressed in the appended claims.
  • Unless defined in the context of the present description, otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
  • Moreover, by way of a non-limiting example, the methods and arrangements of the present invention are illustrated by being used in the memory leakage scenario. However, it should be understood that the present invention can be applied to other kinds of resources, which are limited in terms of their amounts or usage and cannot be reused partially or completely due to errors or faults. For example, one kind of the resources can be file descriptors, which are assigned to each process or task in a UNIX-like operation system and if not properly released, the process will suffer core-dump consequently. Other kinds of such resources include but are not limited to computing capability and communication channels.
  • According to one embodiment of the present invention, resource usage is periodically or randomly monitored on whether it has a trend to increase or rises steadily, and if such trend exists, it is determined that a resource leakage occurs. This approach may exclude the situation that a peak of the resource usage merely results from a high load during operation.
  • Note that in the present invention, a variety of methods and arrangements can be used to efficiently and effectively “probe” the trend to increase or the steady increase, which will be described in detail.
  • The methods and arrangement, as shown in the following drawings, can be used in a variety of computing system, e.g., including but not limited to server, personal computer, laptop computer, embedded computer and like. Moreover, the methods can be implemented in form of software, hardware, firmware or the combination thereof.
  • For illustrative purpose, the following embodiments are assumed to be applied to a computing system comprising a processor, a memory, I/O device(s), an operation system, and application(s). The computing system further comprises an arrangement for detecting memory leakage. Although the following embodiments according to the present invention are described in conjunction with the computing system having the above structure, it is not intended to limit the present invention to any specific system.
  • FIG. 2 is a flowchart illustrating method steps for memory leakage detection according to one exemplary embodiment of the present invention.
  • Referring to FIG. 2, at step 210, the arrangement measures or obtains the current memory usage of the computing system. The current value, together with the values previously measured, constitute a time series. In other words, each of the values can be regarded as one of samples in the time series. Note that the word “measure” herein means that the measuring is performed by either the arrangement itself or other components external to the arrangement, e.g., the underlying functionality or routine provided by the operation system and invoked by the arrangement.
  • Then, the process proceeds to step S220, where the arrangement determines whether there is a steady rising among the samples of the time series, i.e., whether the samples tend to increase. If such rising is found, the process proceeds to step S230; otherwise, the process proceeds to step S240.
  • At step S230, the arrangement generates a message indicating that a memory leakage occurs and transmits it to the operation system so that appropriate actions will be taken to prohibit the performance of the computing system from being degraded.
  • On the other hand, at step 240, the arrangement waits for a predetermined interval and then returns to step S210. With this interval, the samples of the time series are measured or obtained periodically. However, the fixed interval is unnecessarily and indeed, measuring may occur randomly. For example, the arrangement may be configured to initiate a leakage detection process in response to the receipt of a trigger signal, e.g., from the operation system.
  • FIG. 3 is a flowchart illustrating method steps for memory leakage detection according to one exemplary embodiment of the present invention.
  • Referring to FIG. 3, at step 310, the arrangement “listen for” the trigger signal or command from the operation system. If receiving the signal, the process proceeds to step S320; otherwise, the arrangement continues to listen for the signal or command.
  • At step 320, the arrangement measures or obtains the current memory usage of the computing system to form a time series consisting of the current value and the history values.
  • Then, the process proceeds to step S330, where the arrangement determines whether the samples of the time series tends to increase. If such trend is found, the process proceeds to step S340; otherwise, the process proceeds to step S310.
  • At step S340, the arrangement generates a message that a memory leakage occurs and transmits the message to the operation system, which, in turn, takes appropriate actions.
  • Note that in the above embodiments, the memory usage refers to that of the whole computing system. However, the embodiments as shown in FIGS. 2 and 3 can also be applied to the case where the memory usage of an executing program or a task needs to be monitored. These variation and modification are within the spirit and principle of the present invention.
  • Now explains how to determine whether the samples of the time series tend to increase or rise, i.e., whether there exists a steady increase or a trend to increase among the samples of the time series.
  • Assuming that the memory usage is periodically measured with the interval T, whereby generating a time series denoted as (m1, m2, m3, . . . mn, . . . ), herein, where mn represents the sample measured at the nth time-point. According to one embodiment of the present invention, the trend or the steady increase is characterized by the following set of ascending samples:

  • (S 1 , . . . ,S i ,S i+1 , . . . ,S k),S i+1 >S i,1≦i≦k−1  (1)

  • S i =m x ,S i+1 =m y ,x<y  (2)
  • where k is the number of elements in the set of the ascending samples, Si is the ith element in the set of the ascending samples, mx and my are the xth and the yth samples in the time series.
  • In other words, if from the time series (m1, m2, m3, . . . mn, . . . ), one can find out a plurality of samples (e.g., k elements in this embodiment) ascending in time, it is determined that there exists a trend to increase or a steady increase. Visually, a set of the ascending samples under the conditions (1) and (2) appears as a number of “valleys” which are raised with time, though the samples may fluctuate.
  • FIG. 4 is a flowchart illustrating an exemplary algorithm for searching for the set of the ascending samples from the time series.
  • Referring to FIG. 4, at step S410, a new value for the memory usage, denoted as m herein, is obtained as the current value. As noted above, the value can be periodically or randomly measured.
  • Then, at step S420, if it is determined that the array for the ascending samples, denoted as S herein, is empty, the procedure proceeds to step S430, where the current value m is recorded as the first element S1 in the array S, and further to step S410; otherwise, proceeding to step S440.
  • At step S440, any element being not less than the current value m is removed from the array S. Subsequently, at step S450, the current value is recorded as the tail or last element of the array S, denoted as Sj herein.
  • Then, the process proceeds to step 460 to determine whether the number of the elements in the array S is equal to a predetermined parameter k, i.e., whether there exists a set of ascending samples in the time series. If it is the case, the process proceeds to step S470, where the event of the steady rising is reported; otherwise, returning step S410.
  • Below is an illustrative C pseudo-code segment for implementing the algorithm of FIG. 4.
  • 1 static int S[k] ; /* define an array with k elements */
    2
    3 while(1) /* Loop to measure memory usage periodically */
    4 {
    5 get the current memory usage “m”;
    6
    7 for (int j = 0; j < k; j++) {
    8  if (S[j]==0) {
    9   S[j]=m;
    10   break;
    11  } else if( m <= S[j] ) {
    12   S[j]=m;
    13   set S[j+1]..S[k−1] as zero;
    14   break;
    15  }
    16 }
    17 if ( j== k−1 ) {
    18  /*
    19  * The pattern is found. All elements in array S[ ] are non-zero.
    20  * And S[i+1]>S[i]. It means continuous increase in memory usage,
    21  * indicating there could be memory leak problem!
    22  * Stop looping and exit the algorithm.
    23  */
    24  return 1;
    25 }
    26
    27 delay( Delta_t ); /* delay delta_t interval to measure memory usage */
    28 }
  • FIG. 5 shows a simulation diagram obtained by means of the algorithm of FIG. 4. As seen from FIG. 5, the memory usage is periodically measured at the timings t1, t2, t3, . . . , t21, . . . , with a fixed interval T therebetween. At the timing t18, the procedure has detected a set of ascending samples:

  • (S 1 , . . . ,S i ,S i+1 , . . . ,S k),S i+1 >S i,1≦i≦k−1
  • Following the timing t18, the memory usage increases abruptly, causing a crash in the system under simulation test. If the procedure functions as a detector for memory leakage, the crash can be avoided.
  • Still referring to FIG. 5, although the memory usage presents a prompt increase between the timings t8 and t9, it drops at the subsequent timings t10 and t11 due to the decreased load. With the above algorithm, this false signal will be well recognized and thus ignored.
  • In the example, the number of the samples k is set as 8. It should be noted that this parameter, along with the interval ΔT can be adjusted to adapt to a variety of occasions. For example, it is considerable to adopt ΔT having a greater value for a slow memory leak and ΔT having a smaller value for a quick memory leak. As for the number of the samples k, it is found that the greater k will improve detection accuracy and reliability but may need more time.
  • As described above, the trend to increase in the time series can be detected by searching for the set of ascending samples therein. In another embodiment which will be described in detail, an algorithm based on moving-average (MA) is used.
  • Still assuming that the memory usage is periodically measured with the interval ΔT, whereby generating a time series denoted as (m1, m2, m3, . . . mn, . . . ) herein. According to the embodiment, the trend or the steady increase is determined based on the change of the moving average of the time series. In particular, if the moving average is greater than a predetermined threshold, it is determined that the time series has a steady increase; otherwise, no steady increase occurs. Alternatively, the moving average may be replaced by its changing rate.
  • While obtaining a new measurement for the memory usage, e.g., the nth sample in the time series, the moving average of the time series MA can be updated as follows:
  • M A = i = n - h + 1 n m i h ( 3 )
  • where mi is the ith sample in the time series, and h is the number of the samples for averaging.
  • Note that the number of the samples and the threshold are adjustable so as to adapt to a variety of occasions. For example, the number and the threshold at a lower level will result in a prompt response to the memory leakage but risk a false detection. On the other hand, with a higher level for these parameters, accuracy and reliability are anticipated but sensitivity decreases.
  • FIG. 6 is a block diagram illustrating one embodiment of an arrangement for detecting a memory leakage according to the present invention.
  • The arrangement as shown in FIG. 6 may be implemented in form of a software tool for monitoring real memory usage status, which runs on or is integrated with the operating system, a circuitry for specific purpose, e.g., Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), or the combination thereof. It can also be implemented as a standalone tool for debugging memory leak in development phase.
  • Referring to FIG. 6, the arrangement 600 comprises a first unit 610, a second unit 620 and a third unit 630. In case of the arrangement embodied as a software tool, the first to third units 610-630 can be implemented in form of separate component or module. The first unit 610 is responsible for obtaining or measuring a plurality of samples for the memory usage of the computing system by invoking the routine provided by the operation system. As described above, the samples constitute a time series. Again, the memory usage can be either periodically or randomly measured.
  • The second unit 620 communicates with the first unit 610 and the third unit 630. It determines whether the samples obtained by the first unit 610 have a trend to increase. If such trend is found, the third unit 630 will report the occurrence of the memory leakage to the operation system. In this embodiment, the second unit 620 can be configured to perform the determination by using the methods as described above.
  • In comparison with the conventional technology for detecting the memory leakage, the methods and arrangement herein disclosed, in conjunction with FIGS. 2, 3, 4, 5 and 6, enables an instant, accurate and reliable detection on memory leak to avoid system crash. Particularly, the memory usage peak caused by dynamic service load can be effectively filtered out.
  • According to one embodiment of the present invention, it provides a computer program product adapted to carry out the methods as described above when run on a computer.
  • According to another embodiment of the present invention, it provides a computer readable medium comprising computer executable program code adapted to carry out the steps of anyone of the methods as described above.
  • It should be noted that the aforesaid embodiments are illustrative of this invention instead of restricting this invention, substitute embodiments may be designed by those skilled in the art without departing from the scope of the claims enclosed. The wordings such as “include”, “including”, “comprise” and “comprising” do not exclude elements or steps which are present but not listed in the description and the claims. It also shall be noted that as used herein and in the appended claims, the singular forms “a”, “an”, and “the” include plural referents unless the context clearly dictates otherwise. This invention can be achieved by means of hardware including several different elements or by means of a suitably programmed computer. In the unit claims that list several means, several ones among these means can be specifically embodied in the same hardware item. The use of such words as first, second, third does not represent any order, which can be simply explained as names.

Claims (14)

1-12. (canceled)
13. A method for detecting a resource leakage in a computing system, the method comprising:
obtaining a plurality of samples in a time series, each sample representing usage concerning a resource in the computing system;
determining whether the samples tend to increase;
reporting occurrence of a resource leakage in the computing system in response to determining that the samples tend to increase.
14. The method of claim 13, wherein the determining comprises determining that the samples tend to increase if there exists a set of ascending samples in the time series.
14. The method of claim 14, wherein the set of ascending samples are characterized as (Si, . . . , Si, Si+1, . . . , Sk), where:

S i+1 >S i;

1≦i≦k−1

S i =m x ,S i+1 =m y ,x<y;
k is the number of elements in the set of the ascending samples;
Si is the ith element in the set of the ascending samples;
mx and my are the xth and the yth samples in the time series.
16. The method of claim 13, wherein the samples are periodic.
17. The method of claim 13, wherein the resource is memory available for an application, a process, or the whole computing system.
18. The method of claim 13, wherein the resource is file descriptors available for an application, a process, or the whole computing system.
19. An arrangement for detecting a resource leakage in a computing system, comprising:
a first unit configured to obtain a plurality of samples in a time series, each sample representing usage concerning a resource in the computing system;
a second unit configured to determine whether the samples obtained by the first unit tend to increase;
a third unit configured to report occurrence of a resource leakage in the computing system in response to determining that the samples tend to increase.
20. The arrangement of claim 19, wherein the second unit is configured to determine the samples tend to increase if there exists a set of ascending samples in the time series.
21. The arrangement of claim 20, wherein the set of ascending samples are characterized as (Si, . . . , Si, Si+1, . . . , Sk), where:

S i+1 >S i;

1≦i≦k−1

S i =m x ,S i+1 =m y ,x<y;
k is the number of elements in the set of the ascending samples;
Si is the ith element in the set of the ascending samples;
mx and my are the xth and the yth samples in the time series.
22. The arrangement of claim 21, wherein the first unit is configured to obtain the samples by measuring the usage periodically.
23. The arrangement of claim 19, wherein the resource is memory available for an application, a process, or the whole computing system.
24. The arrangement of claim 19, wherein the resource is file descriptors available for an application, a process, or the whole computing system.
25. A computer program product stored in a non-transitory computer readable medium for detecting a resource leakage in a computing system, the computer program product comprising software instructions which, when run on a computer, causes the computer to:
obtain a plurality of samples in a time series, each sample representing usage concerning a resource in the computing system;
determine whether the samples tend to increase;
report occurrence of a resource leakage in the computing system in response to determining that the samples tend to increase.
US13/814,045 2011-03-15 2011-03-15 Detection on Resource Leakage Abandoned US20130145220A1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/000407 WO2012122672A1 (en) 2011-03-15 2011-03-15 Detection on resource leakage

Publications (1)

Publication Number Publication Date
US20130145220A1 true US20130145220A1 (en) 2013-06-06

Family

ID=46830008

Family Applications (1)

Application Number Title Priority Date Filing Date
US13/814,045 Abandoned US20130145220A1 (en) 2011-03-15 2011-03-15 Detection on Resource Leakage

Country Status (4)

Country Link
US (1) US20130145220A1 (en)
EP (1) EP2686770A4 (en)
CN (1) CN103460194B (en)
WO (1) WO2012122672A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070974A1 (en) * 2008-09-17 2010-03-18 Canon Kabushiki Kaisha Support apparatus for information processing apparatus, support method and computer program
US20140189438A1 (en) * 2012-12-31 2014-07-03 Bmc Software, Inc. Memory leak detection
US20150067289A1 (en) * 2013-08-30 2015-03-05 Verizon Patent And Licensing Inc. Method and apparatus for implementing garbage collection within a computing environment
US20160041848A1 (en) * 2013-05-21 2016-02-11 Huawei Technologies Co., Ltd. Methods and Apparatuses for Determining a Leak of Resource and Predicting Usage Condition of Resource
WO2018018575A1 (en) * 2016-07-29 2018-02-01 Microsoft Technology Licensing, Llc Detection of computing resource leakage in cloud computing architectures
US10289472B2 (en) * 2014-08-26 2019-05-14 Huawei Technologies Co., Ltd. Resource leak detection method, apparatus, and system
US10303534B2 (en) * 2017-07-20 2019-05-28 Cisco Technology, Inc. System and method for self-healing of application centric infrastructure fabric memory
US11269748B2 (en) * 2020-04-22 2022-03-08 Microsoft Technology Licensing, Llc Diagnosing and mitigating memory leak in computing nodes

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708605B (en) * 2015-07-14 2021-08-24 腾讯科技(深圳)有限公司 Method and device for detecting resource leakage
CN107423213B (en) * 2017-04-11 2020-12-18 腾讯科技(深圳)有限公司 File descriptor distribution detection method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6640290B1 (en) * 1998-02-09 2003-10-28 Microsoft Corporation Easily coalesced, sub-allocating, hierarchical, multi-bit bitmap-based memory manager
US20050076184A1 (en) * 2003-10-01 2005-04-07 Schumacher Michael K. Apparatus and method for detecting memory leaks
US20060259528A1 (en) * 2005-05-13 2006-11-16 Microsoft Corporation Implementation for collecting unmanaged memory
US7234080B2 (en) * 2002-10-18 2007-06-19 Computer Associates Think, Inc. Locating potential sources of memory leaks
US7765528B2 (en) * 2005-09-21 2010-07-27 Hewlett-Packard Development Company, L.P. Identifying sources of memory retention

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7089460B2 (en) * 2003-02-28 2006-08-08 Microsoft Corporation System and method for memory leak detection
US7447694B2 (en) * 2003-09-29 2008-11-04 International Business Machines Corporation Automated scalable and adaptive system for memory analysis via online region evolution tracking
DE102006029138A1 (en) * 2006-06-22 2007-12-27 Dspace Digital Signal Processing And Control Engineering Gmbh Memory leakages detection method for use in computer program product, involves recording information of occurred allocation in allocation list during program run with each allocation of memory area
US7475214B2 (en) * 2006-08-16 2009-01-06 International Business Machines Corporation Method and system to optimize java virtual machine performance
CN101206616B (en) * 2006-12-19 2010-06-09 中国电信股份有限公司 Method for testing resource leakage of graphical interface program and method for locating question

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6640290B1 (en) * 1998-02-09 2003-10-28 Microsoft Corporation Easily coalesced, sub-allocating, hierarchical, multi-bit bitmap-based memory manager
US7234080B2 (en) * 2002-10-18 2007-06-19 Computer Associates Think, Inc. Locating potential sources of memory leaks
US20050076184A1 (en) * 2003-10-01 2005-04-07 Schumacher Michael K. Apparatus and method for detecting memory leaks
US20060259528A1 (en) * 2005-05-13 2006-11-16 Microsoft Corporation Implementation for collecting unmanaged memory
US7765528B2 (en) * 2005-09-21 2010-07-27 Hewlett-Packard Development Company, L.P. Identifying sources of memory retention

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9135070B2 (en) * 2008-09-17 2015-09-15 Canon Kabushiki Kaisha Preventing memory exhaustion of information processing apparatus based on the predicted peak memory usage and total memory leakage amount using historical data
US20100070974A1 (en) * 2008-09-17 2010-03-18 Canon Kabushiki Kaisha Support apparatus for information processing apparatus, support method and computer program
US11048616B2 (en) 2012-12-31 2021-06-29 Bmc Software, Inc. Memory leak detection
US20140189438A1 (en) * 2012-12-31 2014-07-03 Bmc Software, Inc. Memory leak detection
US9003233B2 (en) * 2012-12-31 2015-04-07 Bmc Software, Inc. Memory leak detection
US20160041848A1 (en) * 2013-05-21 2016-02-11 Huawei Technologies Co., Ltd. Methods and Apparatuses for Determining a Leak of Resource and Predicting Usage Condition of Resource
US9846601B2 (en) * 2013-05-21 2017-12-19 Huawei Technologies Co., Ltd. Method and apparatuses for determining a leak of resource and predicting usage of resource
US20150067289A1 (en) * 2013-08-30 2015-03-05 Verizon Patent And Licensing Inc. Method and apparatus for implementing garbage collection within a computing environment
US9336138B2 (en) * 2013-08-30 2016-05-10 Verizon Patent And Licensing Inc. Method and apparatus for implementing garbage collection within a computing environment
US10289472B2 (en) * 2014-08-26 2019-05-14 Huawei Technologies Co., Ltd. Resource leak detection method, apparatus, and system
WO2018018575A1 (en) * 2016-07-29 2018-02-01 Microsoft Technology Licensing, Llc Detection of computing resource leakage in cloud computing architectures
US11334463B2 (en) 2016-07-29 2022-05-17 Microsoft Technology Licensing, Llc Detection of computing resource leakage in cloud computing architectures
US20220276946A1 (en) * 2016-07-29 2022-09-01 Microsoft Technology Licensing, Llc Detection of computing resource leakage in cloud computing architectures
US11775411B2 (en) * 2016-07-29 2023-10-03 Microsoft Technology Licensing, Llc Detection of computing resource leakage in cloud computing architectures
US10303534B2 (en) * 2017-07-20 2019-05-28 Cisco Technology, Inc. System and method for self-healing of application centric infrastructure fabric memory
US11055159B2 (en) 2017-07-20 2021-07-06 Cisco Technology, Inc. System and method for self-healing of application centric infrastructure fabric memory
US11269748B2 (en) * 2020-04-22 2022-03-08 Microsoft Technology Licensing, Llc Diagnosing and mitigating memory leak in computing nodes
US20220188207A1 (en) * 2020-04-22 2022-06-16 Microsoft Technology Licensing, Llc Diagnosing and mitigating memory leak in computing nodes
US11775407B2 (en) * 2020-04-22 2023-10-03 Microsoft Technology Licensing, Llc Diagnosing and mitigating memory leak in computing nodes

Also Published As

Publication number Publication date
EP2686770A4 (en) 2015-08-26
WO2012122672A1 (en) 2012-09-20
CN103460194A (en) 2013-12-18
EP2686770A1 (en) 2014-01-22
CN103460194B (en) 2016-12-21

Similar Documents

Publication Publication Date Title
US20130145220A1 (en) Detection on Resource Leakage
CN109783262B (en) Fault data processing method, device, server and computer readable storage medium
US10296408B2 (en) Operation management apparatus, operation management method, and program
US8850270B2 (en) Test selection
US20150074469A1 (en) Methods, apparatus and system for notification of predictable memory failure
US20120151276A1 (en) Early Detection of Failing Computers
US9778972B2 (en) Operation management device, operation management method
US9846601B2 (en) Method and apparatuses for determining a leak of resource and predicting usage of resource
CN107678908B (en) Log recording method and device, computer equipment and storage medium
US20160055046A1 (en) System fault detection and processing method, device, and computer readable storage medium
CN107992410B (en) Software quality monitoring method and device, computer equipment and storage medium
TW201636839A (en) Method and apparatus of realizing resource provisioning
US20030084376A1 (en) Software crash event analysis method and system
CN106997316B (en) System and method for detecting abnormal increase of memory
US20120185732A1 (en) Method of measuring and diagnosing misbehaviors of software components and resources
US8490062B2 (en) Automatic identification of execution phases in load tests
CN113347058B (en) Method and system for testing vehicle CAN network period consistency
CN107153601B (en) Unit performance test method and device
WO2016063816A1 (en) Device and method for detecting abnormality pre-indications in a computer system
US8265906B2 (en) Automatic identification of execution phases in load tests
CN106354635B (en) A kind of the program code segments self checking method and device of embedded device
CN111307246A (en) Method and device for monitoring abnormal oil level of machine in working state
US9405872B2 (en) System and method for reducing power of a circuit using critical signal analysis
CN111104284B (en) Service health detection method and device, computer equipment and storage medium
CN112749013A (en) Thread load detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
AS Assignment

Owner name: TELEFONAKTIEBOLAGET L M ERICSSON (PUBL), SWEDEN

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:LV, PENG;REEL/FRAME:029748/0278

Effective date: 20110412

STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION