Memory management method and apparatus

A memory management and memory technology, applied in the field of communication, can solve problems affecting memory allocation performance and low memory recycling rate, and achieve the effects of improving user experience, speed and success rate, and improving efficiency

Active Publication Date: 2018-04-06
HUAWEI TECH CO LTD
View PDF15 Cites 17 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] The embodiment of the present invention provides a memory management method and device, which are used to solve the problem that the existi

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Memory management method and apparatus
  • Memory management method and apparatus
  • Memory management method and apparatus

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach

[0066] Mode 1. For each page frame (page frame) in the Least Recently Used (LRU) linked list of the memory, if it is determined that the page frame is dirty and allows write-back, or allows swapping out, determine the The memory pages in the page frame are memory pages that need to be swapped out.

[0067] Wherein, writing back refers to writing the data of the memory page back to the file system, and swapping out refers to exchanging the data of the memory page to the swap partition.

[0068] In this method, the page frames in each LRU linked list are scanned sequentially, and if it is determined that the page frame is dirty and allows write-back, or allows swapping out, then determine the memory page stored in the page frame as the memory page that needs to be swapped out . Among them, the page frame that allows write-back and is dirty refers to the page frame that has been modified after the file is loaded into the memory and has not been synchronized to the file system. W...

Embodiment 1

[0080] Embodiment 1, please refer to image 3 , is a schematic diagram of the page swapping process described in this embodiment, including the following process:

[0081] Step 301, scanning the page frames in each LRU linked list;

[0082] Step 302. For each page frame, determine whether the set conditions are satisfied, wherein the set conditions include all mapping relationships indicating that the page frame is to be reclaimed forcibly and need to be removed, or the page frame is dirty and allows write-back, or allows swap out;

[0083] If yes, execute step 303;

[0084] If not, then execute step 308;

[0085] Step 303, using the page frame descriptor (struct page), scan control structure information (struct scan_control) and ttu_flag as parameters, and using the encapsulated single page frame recovery function as a work function to generate a work task corresponding to the page frame;

[0086] Step 304, traversing all available CPUs in the system, searching for a CPU ...

Embodiment 2

[0113] Example 2, please refer to Figure 5 , is a schematic diagram of the page swapping process described in this embodiment, including the following process:

[0114] Step 501, traversing page directories and page tables at all levels corresponding to each VMA of the process, and filtering out page table entries whose pages are not in memory;

[0115] Step 502, judging whether the current VMA has been traversed and the isolated page linked list is not empty;

[0116] If so, then execute step 505;

[0117] If not, then execute step 503;

[0118] Step 503, isolate the page frame corresponding to each page table item corresponding to the current VMA from the LRU linked list, and add the page frame descriptor of the isolated page frame to the isolated page linked list;

[0119] Step 504, check whether the number of page frames in the isolation page linked list reaches the number of pages exchanged at a time, and the number of pages exchanged at a time is generally 32 by defa...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

Embodiments of the invention provide a memory management method and apparatus, which is used for solving the problem of serious influence on memory allocation performance in a scene of system memory insufficiency due to relatively low memory recycling rate at present. The method comprises the steps of determining memory pages needed to be swapped out in a memory; for each memory page needed to beswapped out, according to the memory page, generating a working task used for executing recycling on the memory page; and determining a special working thread, and allocating each working task to thespecial working thread for execution. Therefore, multi-CPU parallel processing of memory recycling is realized, the memory recycling speed is increased, and the user experience is improved.

Description

technical field [0001] The invention relates to the technical field of communication, in particular to a memory management method and device. Background technique [0002] All programs in the computer run in the memory, and the memory is also a medium for temporarily storing the calculation data in the central processing unit (Central Processing Unit, referred to as CPU) and exchanging data with external storage such as external disks. Therefore, the use of memory has a very large impact on computer performance. This is especially true for embedded terminals. The Android system is an operating system based on the Linux kernel and oriented to mobile terminals. All available memory is limited to system random-access memory (Random-Access Memory, RAM for short). In the Android system, when the application exits, the memory occupied by it is not cleaned up, and the Linux kernel process continues to exist accordingly, that is, "exit but not close", so that the user can get a res...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F12/02G06F12/123
CPCG06F12/0253G06F12/123G06F12/08G06F2212/1024G06F12/126G06F12/023G06F12/0882G06F12/0246G06F12/02
Inventor 陈秋林姚旺来应云剑
Owner HUAWEI TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products