Kernel-module memory management method for preventing memory leaks and multiple memory releases

A kernel module and memory leak technology, applied in the direction of memory address/allocation/relocation, etc., can solve problems such as limited system busyness, inability to completely solve memory, leaks, etc., to prevent the release of invalid memory, meet kernel availability, The effect of preventing memory leaks
CN102103541AActive Publication Date: 2011-06-22NAT UNIV OF DEFENSE TECH

Patent Information

Authority / Receiving Office
CN Β· China
Current Assignee / Owner
NAT UNIV OF DEFENSE TECH
Publication Date
2011-06-22

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention discloses a kernel-module memory management method for preventing memory leaks and multiple memory releases, and the method comprises the following implementation steps: 1) establishing an array of records; 2) when a kernel module requires a system to allocate memories, adding memory allocation records associated with the allocated memories into the array of records; 3) when the kernel module requires the system to release memories, searching memory allocation records associated with the memories to be released in the array of records, if the associated memory allocation records exist, executing memory release, and cancelling the memory allocation records; and if the associated memory allocation records do not exist, issuing an alarm of 'multiple releases'; and 4) when the kernel module exits, scanning the array of records, if the array of records still has memory allocation records, releasing the memories associated with the memory allocation records one by one according to the memory allocation records, and finally, clearing the array of records. By utilizing the method disclosed by the invention, the kernel modules can be prevented from having the phenomena of memory leaks and multiple memory releases; and the method has the advantages of good memory allocation capability, low congestion degree of an operating system, less occupied resources, small memory-footprint, and good adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to a memory management method of an operating system kernel module, in particular to a memory management method of the kernel module that prevents memory leaks and multiple memory release failures in the kernel module with independent functions in the operating system. Background technique

[0002] The operating system kernel is a system that implements multiple functions. The inherent independence of functions and the extended characteristics required by the kernel system make modularization an important composition method of the operating system kernel. Usually the kernel is composed of multiple modules that perform different functions, each module has an independent entrance and exit, and has a closed-loop control flow. Memory is the most scarce resource during the operation of the kernel system. Dynamic on-demand allocation is the main method for the operating system kernel to meet unlimited application needs with limited memo...

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