Memory management method used in Linux system

A memory management and memory technology, applied in memory system, memory architecture access/allocation, memory address/allocation/relocation, etc., can solve problems such as reducing memory usage, performance loss, increasing overhead, etc., to reduce the possibility of TLBmiss , the effect of saving query time and improving memory access speed

Active Publication Date: 2016-08-24
WUHAN HONGXIN TECH SERVICE CO LTD
View PDF4 Cites 40 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

If possible, adjacent free blocks should be merged into larger free blocks. However, as mentioned above, the memory allocated by brk needs to be released after the high-address memory is released. Only at this time can the free blocks be merged to complete the heap. Compression, in most cases, due to frequent allocation and release of memory on the heap, it will cause performance loss, and will cause a large number of memory fragments in the system, reducing memory usage
[0009] The default memory management function also takes into account multi-threaded applications, which need to be locked every time memory is allocated and released, which also increases overhead

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 used in Linux system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] The technical solution of the present invention will be described in detail below in conjunction with the drawings and embodiments.

[0040] The embodiment of the present invention provides a memory management method under a Linux system, which uses a 2M hugepage physical memory page to reduce TLB miss; by calculating the relationship between the virtual address and the physical address, it is obtained which numa node the mapped hugepage belongs to, and according to the physical address Sort, apply for a fixed-length memory pool in hugepage; apply for free heap in hugepage; legal memory release.

[0041] Specifically, it includes pre-setting n 2M hugepage physical memory in the Linux operating system, and then using the Hugetlbfs file system to map the preset hugepage physical memory to the hugefile file in the directory mounted by Hugetlbfs; by reading / proc / self / pagemap page file, get the mapping relationship between virtual address and physical address in this proce...

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

The invention provides a memory management method used in a Linux system. A large page memory is used in a Linux environment, and the memory configuration working process, the memory application process and memory release process are executed based on the large page memory; the memory configuration working process comprises the steps of calculating the relation between virtual addresses and physical addresses to determine the numa node a mapped hugepage belongs to and performing sorting according to the physical addresses; the memory application process comprises the steps of memory pool configuration application and common memory application. The memory management method keeps the high efficiency advantage of static memory allocation and adopts the 2MB hugepage to replace a 4KB page, the page query time is saved, and the TLB miss probability is reduced. In addition, a hugepage memory is not exchanged to a disk, it is ensured that the memory is always used by an applied application program, priority is given to use a local memory during memory application, and the memory access speed is improved.

Description

technical field [0001] The invention relates to the technical field of computer memory management, and provides a memory management method under a Linux system. Background technique [0002] In the Linux system, users use the libc library function malloc (or similar functions) to allocate memory space on the heap. There are two ways for libc to allocate memory, which are completed by two system call functions brk and mmap respectively. [0003] In the kernel, the heap is a virtual address (vma, virtual memory address) with one end fixed and one end scalable. The scalable end is adjusted through the system call function brk. When the memory requested by the process is less than 128k, use the function brk to allocate memory, push _edata (pointing to the highest address of the data segment) to the high address, and allocate a piece of memory space to the process; when the memory requested by the process is larger than 128k, use the function mmap system call, Allocate a block...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F12/02G06F12/10
CPCG06F12/023G06F12/1027G06F2212/1044
Inventor 雷康陈亮王凤纯胡志勇肖伟明余道敏
Owner WUHAN HONGXIN TECH SERVICE 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