IP Library Granted Patent US 7,716,648
Granted Patent B2
US 7,716,648 · App. 11/195,015 · Granted May 11, 2010

Method and apparatus for detecting memory leaks in computer systems

Assignee: Oracle America, Inc.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,716,648
App. No.
11/195,015
Granted
May 11, 2010
Kind
B2
Abstract

A system that identifies processes with a memory leak in a computer system. During operation, the system periodically samples memory usage for processes running on the computer system. The system then ranks the processes by memory usage and selects a specified number of processes with highest memory usage based on the ranking. For each selected process, the system computes a first-order difference of memory usage by taking a difference between the memory usage at a current sampling time and the memory usage at an immediately preceding sampling time. The system then generates a memory-leak index based on the first-order difference and a preceding memory-leak index computed at the immediately preceding sampling time.

Claims (55)

1. A method for identifying processes with a memory leak in a computer system, comprising:

for each process that is being monitored,

computing a first-order difference of memory usage by taking a difference between the memory usage at a current sampling time and the memory usage at an immediately preceding sampling time; and

generating a memory-leak index based on the first-order difference and historical memory-usage information, wherein generating the memory-leak index involves waiting until the process is past an initial blackout period, wherein the process is past the initial blackout period if a minimum run-time for the process has elapsed, and if a minimum number of memory usage samples have been taken.

2. The method of claim 1 , wherein prior to monitoring memory usage, the method further comprises selecting processes to be monitored by:

periodically sampling memory usage for processes running on the computer system;

ranking the processes by memory usage; and

selecting for monitoring a specified number of processes with highest memory usage based on the ranking.

3. The method of claim 1 , wherein the historical memory-usage information includes a preceding memory-leak index computed at the immediately preceding sampling time.

4. The method of claim 1 , wherein the method further comprises:

sorting the processes by decreasing order of memory-leak index; and

reporting a specified number of top processes with non-negative memory-leak indexes.

5. The method of claim 1 , wherein generating the memory-leak index involves applying an exponential forgetting function to the first-order difference and the memory-leak index.

6. The method of claim 5 , wherein a parameter is used to specify the extent to which the exponential forgetting function discards past memory usage values.

7. The method of claim 6 ,

wherein a larger value for the parameter causes the exponential forgetting function to discard past memory usage values more quickly; and

wherein a smaller value for the parameter causes the exponential forgetting function to discard past memory usage values more slowly.

8. The method of claim 1 ,

wherein the memory-leak index is proportional to the magnitude of the memory leak; and

wherein a process with a high memory-leak index indicates that the process is likely to suffer from memory leaks.

9. An apparatus for identifying processes with a memory leak in a computer system, comprising:

a memory; and

a memory-leak detection mechanism;

wherein the memory-leak detection mechanism is configured to:

for each process that is being monitored, to

compute a first-order difference of memory usage by taking a difference between the memory usage at a current sampling time and the memory usage at an immediately preceding sampling time; and to

generate a memory-leak index based on the first-order difference and historical memory-usage information, wherein generating the memory-leak index involves waiting until the process is past an initial blackout period, wherein the process is past the initial blackout period if a minimum run-time for the process has elapsed, and if a minimum number of memory usage samples have been take.

10. The apparatus of claim 9 , wherein prior to monitoring memory usage, to select processes to be monitored, the memory-leak detection mechanism is configured to:

periodically sample memory usage for processes running on the computer system;

rank the processes by memory usage; and

select for monitoring a specified number of processes with highest memory usage based on the ranking.

11. The method of claim 9 , wherein the historical memory-usage information includes a preceding memory-leak index computed at the immediately preceding sampling time.

12. The apparatus of claim 9 , wherein the memory-leak detection mechanism is additionally configured to:

sort the processes by decreasing order of memory-leak index; and to

report a specified number of top processes with non-negative memory-leak indexes.

13. The apparatus of claim 9 , wherein while generating the memory-leak index, the memory-leak detection mechanism is configured to apply an exponential forgetting function to the first-order difference and the memory-leak index.

14. The apparatus of claim 13 , wherein a parameter is used to specify the extent to which the exponential forgetting function discards past memory usage values.

15. The apparatus of claim 14 ,

wherein a larger value for the parameter causes the exponential forgetting function to discard past memory usage values more quickly; and

wherein a smaller value for the parameter causes the exponential forgetting function to discard past memory usage values more slowly.

16. The apparatus of claim 9 ,

wherein the memory-leak index is proportional to the magnitude of the memory leak; and

wherein a process with a high memory-leak index indicates that the process is likely to suffer from memory leaks.

17. A computer system for identifying processes with a memory leak, comprising:

a memory; and

a memory-leak detection mechanism;

wherein the memory-leak detection mechanism is configured to:

for each process that is being monitored, to

compute a first-order difference of memory usage by taking a difference between the memory usage at a current sampling time and the memory usage at an immediately preceding sampling time; and to

generate a memory-leak index based on the first-order difference and historical memory-usage information, wherein generating the memory-leak index involves waiting until the process is past an initial blackout period, wherein the process is past the initial blackout period if a minimum run-time for the process has elapsed, and if a minimum number of memory usage samples have been taken.

18. The computer system of claim 17 , wherein prior to monitoring memory usage, to select processes to be monitored, the memory-leak detection mechanism is configured to:

periodically sample memory usage for processes running on the computer system;

rank the processes by memory usage; and

select for monitoring a specified number of processes with highest memory usage based on the ranking.

19. The computer system of claim 17 , wherein the historical memory-usage information includes a preceding memory-leak index computed at the immediately preceding sampling time.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037306/0292 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 2, 2005
From: VAIDYANATHAN, KALYANARAMAN; THAMPY, SAJJIT; GROSS, KENNY C.
To: SUN MICROSYSTEMS, INC.
Reel/Frame 016855/0938 →
Continuity (1)
Related Publication 20070033365A1 · Feb 8, 2007