Dynamic internal memory leakage detecting method and device based on VxWorks operation system
A technology of vxworks and dynamic memory, which is applied in the direction of memory address/allocation/relocation, software testing/debugging, etc. It can solve the problems of low error detection efficiency and slow speed, and achieve the effect of improving error detection efficiency and speed
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
specific Embodiment approach 1
[0035] Specific implementation mode one: combine figure 1 Describe the present embodiment, the dynamic memory leak detection method based on the VxWorks operating system described in this embodiment, the dynamic memory leak detection method based on the VxWorks operating system of the present invention, it is based on the industrial computer and the host computer that the VxWorks operating system is installed. Yes, the industrial computer is embedded with industrial computer software, and the working process of the industrial computer software includes the following steps:
[0036] Steps for calling function LC_malloc() and function LC_free() to realize dynamic memory tracking, and recording the memory allocation and memory release information of each event item in the form of a log;
[0037] The function LC_malloc() is used to allocate memory according to the parameters of the memory size required by the user. If a valid memory address is returned, the dynamic memory allocati...
specific Embodiment approach 2
[0055] Specific embodiment two: present embodiment is the further limitation of the dynamic memory leak detection method based on VxWorks operating system described in specific embodiment one, and it also includes:
[0056] By means of macro definition, rewrite the memory allocation function malloc() to obtain the steps of function LC_malloc();
[0057] By means of macro definition, rewrite the memory release function free() to obtain the steps of function LC_free().
[0058] The problem caused by the inconsistency of malloc and LC_malloc function interfaces can be solved by macro definition. Since the detection of memory leaks occurs in the program testing stage, macros can be used to replace the LC_malloc() function, so that the function interfaces provided to users are all malloc( ). The form is as follows:
[0059] #ifdef_DEBUG
[0060] #define DEBUG_MALLOC(size)LC_malloc(size,_FILE_,_LINE_)
[0061] #else
[0062] #define DEBUG_MALLOC malloc
[0063] #endif
[0064...
specific Embodiment approach 3
[0068] Specific embodiment three: this embodiment is a further limitation of the dynamic memory leak detection method based on the VxWorks operating system described in specific embodiment one,
[0069] The function LC_malloc () is used to allocate memory according to the parameters of the user's required memory size:
[0070] The function LC_malloc() is used to allocate memory according to the parameters in the physical block linked list; the function LC_free() is used to release the specified memory as:
[0071] The function LC_free() is used to release the memory specified in the physical block list;
[0072] The physical block linked list is used for storing the state of all memory blocks and connecting all allocated memory blocks and unallocated memory blocks adjacent to each other in physical position.
[0073] In this embodiment, a new data structure is introduced to manage the linked list. The traditional memory management method is to use two linked lists, one is an ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com