# US 2026/0093622 A1 · Memory reclaiming method and electronic device

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

- Number: US 2026/0093622 A1
- Document ID: US20260093622A1
- Status: Published application
- Kind: A1
- Application number: 19/414,035
- Filed: 2025-12-09
- Published: 2026-04-02
- Earliest claimed: 2023-08-07
- Assignees: Honor Device Co., Ltd.
- Applicants: Honor Device Co., Ltd.
- Inventors: Kunli Lin
- Web page: https://patentgrep.com/patent/US20260093622A1

## CPC

- G06F 12/023: {Free address space management}
- G06F 12/0253: {Garbage collection, i.e. reclamation of unreferenced memory}
- G06F 9/4893: {taking into account power or heat criteria (power management in computers in general G06F1/3203; thermal management in computers in general G06F1/206)}
- G06F 9/5016: {the resource being the memory}
- G06F 9/5022: {Mechanisms to release resources}
- G06F 12/0882: Page mode
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 2212/1044: Space efficiency improvement
- G06F 2212/652: Page size control
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

This application provides a memory reclaiming method. The solutions improve memory reclaiming efficiency of an electronic device by enabling a memory control subsystem mechanism. The specific solutions are as follows: A first memory size corresponding to a first application that is run in a background is determined, where the first memory size indicates a size of a memory to be reclaimed from a system memory occupied by the first application, the first memory size decreases as an application level of the first application increases, and the application level indicates activeness of the application during running in the background. The system memory occupied by the first application is reclaimed based on the first memory size.

## Claims

### Claim 1

A memory reclaiming method, applied to an electronic device, wherein each application in the electronic device corresponds to a memory control subsystem memcg, and the method comprises:
determining a first reclaimable memory size corresponding to a first application;
determining a first memory size corresponding to the first application that is run in a background, wherein the first memory size is not greater than the first reclaimable memory size, the first memory size indicates a size of a memory to be reclaimed from a system memory occupied by the first application, the first memory size decreases as an application level of the first application increases, and the application level indicates activeness of the application during running in the background;
reclaiming, based on the first memory size, the system memory occupied by the first application;
wherein the determining a first reclaimable memory size corresponding to the first application comprises:
determining that an application score of the first application is a first score, wherein the application score of the first application decreases as the application level of the first application increases; and
determining the first reclaimable memory size based on the first score and a second memory size and a third memory size corresponding to the first application, wherein the second memory size indicates a size of all anonymous pages in the first application, and the third memory size indicates a size of anonymous pages in the first application that are swapped from the system memory.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the determining the first reclaimable memory size based on the first score and a second memory size and a third memory size corresponding to the first application comprises:
determining a transfer proportion corresponding to the first score, wherein the transfer proportion is a proportion used to determine a transferable anonymous page size in a single application, and a higher first score corresponds to a higher transfer proportion;
determining a product of the transfer proportion and the second memory size as a first anonymous page size; and
removing the third memory size from the first anonymous page size, to determine the first reclaimable memory size.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the determining a first memory size comprises:
obtaining a first proportion of the first reclaimable memory size to a fourth memory size, wherein the fourth memory size is a sum of reclaimable memory sizes corresponding to all applications whose application score is the first score and that are run in the background; and
determining a product of the first proportion and a fifth memory size as the first memory size, wherein the fifth memory size is a total size of memories to-be-reclaimed from all of the applications whose application score is the first score.

### Claim 4 (depends on 2)

The method according to claim 2, wherein each application corresponds to a memcg data structure.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the memcg data structure comprises a field for carrying a reclaimable memory size.

### Claim 6 (depends on 5)

The method according to claim 5, wherein after the determining the first reclaimable memory size, the method further comprises:
writing the determined first reclaimable memory size into the memcg data structure of the corresponding first application.

### Claim 7 (depends on 6)

The method according to claim 6, wherein the determining a first memory size further comprises: obtaining a fourth memory size; and
the obtaining a fourth memory size comprises: obtaining, after a reclaimable memory size is written into the memcg data structure of each application that is run in the background, reclaimable memory sizes from the memcg data structures of applications whose application score is the first score and that are run in the background; and adding up all of the obtained reclaimable memory sizes to obtain the corresponding fourth memory size.

### Claim 8 (depends on 7)

The method according to claim 7, wherein after the reclaiming, based on the first memory size, the system memory occupied by the first application, the method further comprises:
updating the reclaimable memory size in the memcg data structure of the first application by using a difference between the first reclaimable memory size of the first application and the first memory size.

### Claim 9 (depends on 3)

The method according to claim 3, wherein the determining a first memory size further comprises:
calculating a total reclaimable memory size corresponding to all of the applications that are run in the background in the electronic device; and
obtaining the fifth memory size, wherein a proportion of the fifth memory size to a total to-be-reclaimed memory size of the electronic device is equal to a proportion of the fourth memory size to the total reclaimable memory size of the electronic device.

### Claim 10 (depends on 1)

The method according to claim 1, wherein the reclaiming, based on the first memory size, the system memory occupied by the first application comprises:
determining, from anonymous pages of the first application, a target memory page whose system memory occupation is the first memory size, wherein activeness of the target memory page is lower than those of the other anonymous pages of the first application; and
swapping the target memory page from the system memory.

### Claim 11 (depends on 1)

The method according to claim 1, further comprising:
determining a sixth memory size corresponding to a second application that is run in the background, wherein the sixth memory size indicates a size of a memory to be reclaimed from a system memory occupied by the second application, and a size of anonymous pages stored in the system memory by the second application and a size of anonymous pages swapped from the system memory are both the same as those of the first application.

### Claim 12 (depends on 11)

The method according to claim 11, when an application level of the second application is lower than the application level of the first application, the sixth memory size is greater than the first memory size.

### Claim 13 (depends on 12)

The method according to claim 12, further comprising:
reclaiming, based on the sixth memory size, the system memory occupied by the second application, wherein a sum of the first memory size and the sixth memory size are not greater than the total to-be-reclaimed memory size of the electronic device.

### Claim 14

An electronic device, wherein each application in the electronic device corresponds to a memory control subsystem memcg, the electronic device comprises:
a processor and a memory, the memory is configured to store computer instructions, and the processor, when executing the computer instructions, causes the electronic device to perform:
determining a first reclaimable memory size corresponding to a first application;
determining a first memory size corresponding to the first application that is run in a background, wherein the first memory size is not greater than the first reclaimable memory size, the first memory size indicates a size of a memory to be reclaimed from a system memory occupied by the first application, the first memory size decreases as an application level of the first application increases, and the application level indicates activeness of the application during running in the background;
reclaiming, based on the first memory size, the system memory occupied by the first application;
wherein the determining a first reclaimable memory size corresponding to the first application comprises:
determining that an application score of the first application is a first score, wherein the application score of the first application decreases as the application level of the first application increases; and
determining the first reclaimable memory size based on the first score and a second memory size and a third memory size corresponding to the first application, wherein the second memory size indicates a size of all anonymous pages in the first application, and the third memory size indicates a size of anonymous pages in the first application that are swapped from the system memory.

### Claim 15 (depends on 14)

The electronic device according to claim 14, wherein the determining the first reclaimable memory size based on the first score and a second memory size and a third memory size corresponding to the first application comprises:
determining a transfer proportion corresponding to the first score, wherein the transfer proportion is a proportion used to determine a transferable anonymous page size in a single application, and a higher first score corresponds to a higher transfer proportion;
determining a product of the transfer proportion and the second memory size as a first anonymous page size; and
removing the third memory size from the first anonymous page size, to determine the first reclaimable memory size.

### Claim 16 (depends on 14)

The electronic device according to claim 14, wherein the determining a first memory size comprises:
obtaining a first proportion of the first reclaimable memory size to a fourth memory size, wherein the fourth memory size is a sum of reclaimable memory sizes corresponding to all applications whose application score is the first score and that are run in the background; and
determining a product of the first proportion and a fifth memory size as the first memory size, wherein the fifth memory size is a total size of memories to-be-reclaimed from all of the applications whose application score is the first score.

### Claim 17 (depends on 15)

The electronic device according to claim 15, wherein each application corresponds to a memcg data structure.

### Claim 18 (depends on 17)

The electronic device according to claim 17, wherein the memcg data structure comprises a field for carrying a reclaimable memory size.

### Claim 19 (depends on 18)

The electronic device according to claim 18, wherein after the determining the first reclaimable memory size, the electronic device is further caused to perform:
writing the determined first reclaimable memory size into the memcg data structure of the corresponding first application; and
the obtaining a fourth memory size comprises: obtaining, after a reclaimable memory size is written into the memcg data structure of each application that is run in the background, reclaimable memory sizes from the memcg data structures of applications whose application score is the first score and that are run in the background; and adding up all of the obtained reclaimable memory sizes to obtain the corresponding fourth memory size.

### Claim 20

A non-transitory computer-readable storage medium, comprising a computer program or instructions that, when executed on a computer, cause the computer to perform:
determining a first reclaimable memory size corresponding to a first application;
determining a first memory size corresponding to the first application that is run in a background, wherein the first memory size is not greater than the first reclaimable memory size, the first memory size indicates a size of a memory to be reclaimed from a system memory occupied by the first application, the first memory size decreases as an application level of the first application increases, and the application level indicates activeness of the application during running in the background;
reclaiming, based on the first memory size, the system memory occupied by the first application;
wherein the determining a first reclaimable memory size corresponding to the first application comprises:
determining that an application score of the first application is a first score, wherein the application score of the first application decreases as the application level of the first application increases; and
determining the first reclaimable memory size based on the first score and a second memory size and a third memory size corresponding to the first application, wherein the second memory size indicates a size of all anonymous pages in the first application, and the third memory size indicates a size of anonymous pages in the first application that are swapped from the system memory.
