# US 11,307,923 B2 · Memory leak detection

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,307,923 B2
- Document ID: US11307923B2
- Status: Granted
- Kind: B2
- Application number: 16/520,318
- Filed: 2019-07-23
- Published: 2021-01-28
- Granted: 2022-04-19
- Earliest claimed: 2019-07-23
- Assignees: VMware, Inc.
- Applicants: VMware, Inc.
- Inventors: Yong Wang; Xinhua Hong; Jia Yu; Eduard Serra Miralles
- Web page: https://patentgrep.com/patent/US11307923B2

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 11/0709: {in a distributed system consisting of a plurality of standalone computer nodes, e.g. clusters, client-server systems}
- G06F 11/0712: {in a virtual computing platform, e.g. logically partitioned systems}
- G06F 11/073: {in a memory management context, e.g. virtual memory or cache management (memory management G06F12/00; testing of static memory units G11C29/00)}
- G06F 11/0751: {Error or fault detection not based on redundancy (power supply failures G06F1/30; network fault management H04L41/06)}
- G06F 11/0757: {by exceeding a time limit, i.e. time-out, e.g. watchdogs}
- G06F 11/079: {Root cause analysis, i.e. error or fault diagnosis (in a hardware test environment G06F11/22; in a software test environment G06F11/36)}
- G06F 11/0793: {Remedial or corrective actions (recovery from an exception in an instruction pipeline G06F9/3861; by retry G06F11/1402; for recovering from a failure of a protocol instance or entity H04L69/40)}
- H04L 49/90: Buffering arrangements
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2009/45595: {Network integration; Enabling network access in virtual machine instances}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Example methods and systems for memory leak detection. One example may comprise: identifying a set of memory buffers that are available for storing packet information that requires processing by the network device; a first subset that includes one or more first memory buffers that are unallocated, and a second subset that includes one or more second memory buffers that are allocated and storing packet information that is being processed by the network device. The method may also comprise: performing a comparison between (a) the set of memory buffers and (b) the first subset and the second subset; and based on the comparison, identifying a third subset that includes one or more third memory buffers, being leaked memory buffers, that are storing packet information that is no longer being processed by the network device.

## Claims

### Claim 1

A method for a network device to perform memory leak detection, wherein the method comprises:
identifying a set of memory buffers that are available for storing packet information that requires processing by the network device;
identifying, from the set, a first subset that includes one or more first memory buffers that are unallocated, and a second subset that includes one or more second memory buffers that are allocated and storing packet information that is being processed by the network device;
performing a comparison between (a) the set of memory buffers and (b) the first subset and the second subset; and
based on the comparison, identifying a third subset that includes one or more third memory buffers, being leaked memory buffers, that are storing packet information that is no longer being processed by the network device.

### Claim 2 (depends on 1)

The method of claim 1, wherein the method further comprises one or more of the following:
performing a first remediation action to deallocate a particular leaked memory buffer from the third subset; and
performing a second remediation action to dump content of the particular leaked memory buffer to a file for analysis and debugging, wherein the content includes packet header information or payload information.

### Claim 3 (depends on 1)

The method of claim 1, wherein identifying the third subset comprises:
determining that a particular leaked memory buffer from the third subset is not a false positive.

### Claim 4 (depends on 3)

The method of claim 3, wherein identifying the third subset comprises:
monitoring an elapsed time since the particular leaked memory buffer from the third subset is identified; and
in response to detecting that the elapsed time has exceeded a predetermined threshold, determining that the particular leaked memory buffer is not a false positive.

### Claim 5 (depends on 1)

The method of claim 1, wherein identifying the second subset comprises:
identifying a particular second memory buffer storing packet information that is being processed by a packet processing component of the network device, or being queued for processing by the packet processing component.

### Claim 6 (depends on 5)

The method of claim 5, wherein identifying the second subset comprises:
identifying the particular second memory buffer based on one or more of the following: a network interface controller (NIC) queue, a cryptographic queue, a kernel NIC interface (KNI) queue, an inter-core queue, and a packet reassembly queue.

### Claim 7 (depends on 1)

The method of claim 1, wherein the method further comprises:
executing, on the network device, a memory leak detection thread to identify the set of memory buffers at initialization of a memory pool, and to identify the first subset, the second subset and the third subset periodically.

### Claim 8

A non-transitory computer-readable storage medium that includes a set of instructions which, in response to execution by a processor of a network device, cause the processor to perform a method of memory leak detection, wherein the method comprises:
identifying a set of memory buffers that are available for storing packet information that requires processing by the network device;
identifying, from the set, a first subset that includes one or more first memory buffers that are unallocated, and a second subset that includes one or more second memory buffers that are allocated and storing packet information that is being processed by the network device;
performing a comparison between (a) the set of memory buffers and (b) the first subset and the second subset; and
based on the comparison, identifying a third subset that includes one or more third memory buffers, being leaked memory buffers, that are storing packet information that is no longer being processed by the network device.

### Claim 9 (depends on 8)

The non-transitory computer-readable storage medium of claim 8, wherein the method further comprises one or more of the following:
performing a first remediation action to deallocate a particular leaked memory buffer from the third subset; and
performing a second remediation action to dump content of the particular leaked memory buffer to a file for analysis and debugging, wherein the content includes packet header information or payload information.

### Claim 10 (depends on 8)

The non-transitory computer-readable storage medium of claim 8, wherein identifying the third subset comprises:
determining that a particular leaked memory buffer from the third subset is not a false positive.

### Claim 11 (depends on 10)

The non-transitory computer-readable storage medium of claim 10, wherein identifying the third subset comprises:
monitoring an elapsed time since the particular leaked memory buffer from the third subset is identified; and
in response to detecting that the elapsed time has exceeded a predetermined threshold, determining that the particular leaked memory buffer is not a false positive.

### Claim 12 (depends on 8)

The non-transitory computer-readable storage medium of claim 8, wherein identifying the second subset comprises:
identifying a particular second memory buffer storing packet information that is being processed by a packet processing component of the network device, or being queued for processing by the packet processing component.

### Claim 13 (depends on 12)

The non-transitory computer-readable storage medium of claim 12, wherein identifying the second subset comprises:
identifying the particular second memory buffer based on one or more of the following: a network interface controller (NIC) queue, a cryptographic queue, a kernel NIC interface (KNI) queue, an inter-core queue, and a packet reassembly queue.

### Claim 14 (depends on 8)

The non-transitory computer-readable storage medium of claim 8, wherein the method further comprises:
executing, on the network device, a memory leak detection thread to identify the set of memory buffers at initialization of a memory pool, and to identify the first subset, the second subset and the third subset periodically.

### Claim 15

A computer system, comprising:
a processor;
a non-transitory computer-readable medium having stored thereon instructions that, when executed by the processor, cause the processor to:
identify a set of memory buffers that are available for storing packet information that requires processing by the computer system;
identify, from the set, a first subset that includes one or more first memory buffers that are unallocated, and a second subset that includes one or more second memory buffers that are allocated and storing packet information that is being processed by the computer system;
perform a comparison between (a) the set of memory buffers and (b) the first subset and the second subset; and
based on the comparison, identify a third subset that includes one or more third memory buffers, being leaked memory buffers, that are storing packet information that is no longer being processed by the computer system.

### Claim 16 (depends on 1)

The computer system of claim 1, wherein the instructions further cause the processor to perform one or more of the following:
perform a first remediation action to deallocate a particular leaked memory buffer from the third subset; and
perform a second remediation action to dump content of the particular leaked memory buffer to a file for analysis and debugging, wherein the content includes packet header information or payload information.

### Claim 17 (depends on 15)

The computer system of claim 15, wherein the instructions for identifying the third subset cause the processor to:
determine that a particular leaked memory buffer from the third subset is not a false positive.

### Claim 18 (depends on 17)

The computer system of claim 17, wherein the instructions for identifying the third subset cause the processor to:
monitor an elapsed time since the particular leaked memory buffer from the third subset is identified; and
in response to detecting that the elapsed time has exceeded a predetermined threshold, determine that the particular leaked memory buffer is not a false positive.

### Claim 19 (depends on 15)

The computer system of claim 15, wherein the instructions for identifying the second subset cause the processor to:
identify a particular second memory buffer storing packet information that is being processed by a packet processing component of the computer system, or being queued for processing by the packet processing component.

### Claim 20 (depends on 19)

The computer system of claim 19, wherein the instructions for identifying the second subset cause the processor to:
identify the particular second memory buffer based on one or more of the following: a network interface controller (NIC) queue, a cryptographic queue, a kernel NIC interface (KNI) queue, an inter-core queue, and a packet reassembly queue.

### Claim 21 (depends on 15)

The computer system of claim 15, wherein the instructions further cause the processor to:
execute, on the computer system, a memory leak detection thread to identify the set of memory buffers at initialization of a memory pool, and to identify the first subset, the second subset and the third subset periodically.
