IP Library Granted Patent US 10,191,657
Granted Patent B2
US 10,191,657 · App. 14/970,373 · Granted Jan 29, 2019

Compression-based detection of memory inefficiency in software programs

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 10,191,657
App. No.
14/970,373
Granted
Jan 29, 2019
Kind
B2
Abstract

The disclosed embodiments provide a system for detecting and managing memory inefficiency in a software program. During operation, the system obtains a first snapshot of a heap for a software program, wherein the first snapshot includes a first set of objects stored in the heap at a first time. Next, the system applies a compression technique to the first snapshot to obtain a first set of inefficiency metrics for the first set of objects, wherein each inefficiency metric in the first set of inefficiency metrics represents a memory inefficiency of an object in the heap at the first time. The system then outputs the first set of inefficiency metrics with additional attributes of the first set of objects to improve identification of the memory inefficiency in the software program.

Claims (84)

1. A method, comprising:

obtaining a first snapshot of a heap for a software program, wherein the first snapshot comprises a first set of objects stored in the heap at a first time;

applying, by a computer system, a compression technique to the first snapshot to obtain a first set of inefficiency metrics for the first set of objects, wherein each inefficiency metric in the first set of inefficiency metrics represents a memory inefficiency of an object in the heap at the first time;

obtaining a second snapshot of the heap, wherein the second snapshot comprises a second set of objects stored in the heap at a second time;

applying the compression technique to the second snapshot to obtain a second set of inefficiency metrics for the second set of objects;

comparing the first and second sets of inefficiency metrics to identify a trend associated with memory usage in the heap; and

outputting, by the computer system, one or more inefficiency metrics to improve identification of the memory inefficiency in the software program, wherein one or more of the first set of inefficiency metrics and the second set of inefficiency metrics are included in the outputted inefficiency metrics.

2. The method of claim 1 , further comprising:

grouping a subset of the first set of objects by an attribute;

applying the compression technique to the grouped subset to obtain a group inefficiency metric for the grouped subset; and

including the group inefficiency metric in the outputted set of inefficiency metrics.

3. The method of claim 2 , wherein the attribute comprises at least one of:

a type;

a containment relationship;

a size; and

the inefficiency metric.

4. The method of claim 1 , further comprising:

using the first and second sets of inefficiency metrics to identify one or more matches between the first set of objects and the second set of objects; and

using the one or more matches to identify a potential cause of the trend.

5. The method of claim 4 , wherein the trend is associated with at least one of:

a memory leak; and

out-of-memory (OOM) error.

6. The method of claim 1 , further comprising:

matching the first snapshot and the first set of inefficiency metrics to a memory-usage pattern; and

outputting a recommendation for reducing the memory inefficiency in the software program based on the memory-usage pattern.

7. The method of claim 6 , further comprising:

using the first and second sets of inefficiency metrics to determine an improvement in memory usage of the software program after the recommendation has been implemented.

8. The method of claim 1 , wherein outputting the set of inefficiency metrics with the additional attributes of the first set of objects comprises at least one of:

displaying a ranking of the first set of objects by the memory inefficiency; and

identifying a subset of the first set of objects as candidates for improving the memory inefficiency.

9. The method of claim 1 , wherein the set of inefficiency metrics comprises at least one of:

a redundancy; and

a compression ratio.

10. The method of claim 1 , wherein the additional attributes comprise at least one of:

a class name;

an uncompressed size;

a compressed size;

a number of object instances;

a field;

a type; and

a value.

11. An apparatus, comprising:

one or more processors; and

memory storing instructions that, when executed by the one or more processors, cause the apparatus to:

obtain a first snapshot of a heap for a software program, wherein the first snapshot comprises a first set of objects stored in the heap at a first time;

apply a compression technique to the first snapshot to obtain a first set of inefficiency metrics for the first set of objects, wherein each inefficiency metric in the first set of inefficiency metrics represents a memory inefficiency of an object in the heap at the first time;

obtain a second snapshot of the heap, wherein the second snapshot comprises a second set of objects stored in the heap at a second time;

apply the compression technique to the second snapshot to obtain a second set of inefficiency metrics for the second set of objects; and

compare the first and second sets of inefficiency metrics to identify a trend associated with memory usage in the heap; and

output one or more inefficiency metrics to improve identification of the memory inefficiency in the software program, wherein one or more of the first set of inefficiency metrics and the second set of inefficiency metrics are included in the outputted inefficiency metrics.

12. The apparatus of claim 11 , wherein the memory further stores instructions that, when executed by the one or more processors, cause the apparatus to:

group a subset of the first set of objects by an attribute;

apply the compression technique to the grouped subset to obtain a group inefficiency metric for the grouped subset; and

include the group inefficiency metric in the outputted set of inefficiency metrics.

13. The apparatus of claim 11 , wherein the memory further stores instructions that, when executed by the one or more processors, cause the apparatus to:

use the first and second sets of inefficiency metrics to identify one or more matches between the first set of objects and the second set of objects; and

use the one or more matches to identify a potential cause of the trend.

14. The apparatus of claim 11 , wherein the memory further stores instructions that, when executed by the one or more processors, cause the apparatus to:

match the first snapshot and the first set of inefficiency metrics to a memory-usage pattern; and

output a recommendation for reducing the memory inefficiency in the software program based on the memory-usage pattern.

15. The apparatus of claim 14 , wherein the memory further stores instructions that, when executed by the one or more processors, cause the apparatus to:

use the first and second sets of inefficiency metrics to determine an improvement in memory usage of the software program after the recommendation has been implemented.

16. The apparatus of claim 11 , wherein outputting the set of inefficiency metrics with the additional attributes of the first set of objects comprises at least one of:

displaying a ranking of the first set of objects by the memory inefficiency; and

identifying a subset of the first set of objects as candidates for improving the memory inefficiency.

17. The apparatus of claim 11 , wherein the set of inefficiency metrics comprises at least one of:

a redundancy;

a compression ratio; and

a compressed size.

18. A system, comprising:

an analysis module comprising a non-transitory computer-readable medium storing instructions that, when executed by one or more processors, cause the system to:

obtain a first snapshot of a heap for a software program, wherein the first snapshot comprises a first set of objects stored in the heap at a first time;

apply a compression technique to the first snapshot to obtain a first set of inefficiency metrics for the first set of objects, wherein each inefficiency metric in the first set of inefficiency metrics represents a memory inefficiency of an object in the heap at the first time;

obtain a second snapshot of the heap, wherein the second snapshot comprises a second set of objects stored in the heap at a second time;

apply the compression technique to the second snapshot to obtain a second set of inefficiency metrics for the second set of objects; and

compare the first and second sets of inefficiency metrics to identify a trend associated with memory usage in the heap; and

a management module comprising a non-transitory computer-readable medium storing instructions that, when executed by the one or more processors, cause the system to output one or more inefficiency metrics to improve identification of the memory inefficiency in the software program, wherein one or more of the first set of inefficiency metrics and the second set of inefficiency metrics are included in the outputted inefficiency metrics.

19. The system of claim 18 , wherein the non-transitory computer-readable medium of the analysis module further stores instructions that, when executed by the one or more processors, cause the system to:

use the first and second sets of inefficiency metrics to identify one or more matches between the first set of objects and the second set of objects; and

use the one or more matches to identify a potential cause of the trend.

20. The system of claim 18 , wherein the non-transitory computer-readable medium of the analysis module further stores instructions that, when executed by the one or more processors, cause the system to:

match the first snapshot and the first set of inefficiency metrics to a memory-usage pattern;

output a recommendation for reducing the memory inefficiency in the software program based on the memory-usage pattern; and

use the first and second sets of inefficiency metrics to determine an improvement in memory usage of the software program after the recommendation has been implemented.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 1, 2017
From: LINKEDIN CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 044746/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 14, 2016
From: NICOL, JOHN W.; TRAN, CUONG H.; RAMACHANDRA, HARICHARAN K.; SRIDHARAN, BADRINATH K.
To: LINKEDIN CORPORATION
Reel/Frame 037491/0434 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 17, 2015
From: NICOL, JOHN W.; TRAN, CUONG H.; RAMACHANDRA, HARICHARAN K.; SRIDHARAN, BADRINATH K.
To: LINKEDIN CORPORATION
Reel/Frame 037317/0158 →