CN104461918A - Method and system for performing statistic operation on dynamically-applied memory blocks - Google Patents
Method and system for performing statistic operation on dynamically-applied memory blocks Download PDFInfo
- Publication number
- CN104461918A CN104461918A CN201410738311.8A CN201410738311A CN104461918A CN 104461918 A CN104461918 A CN 104461918A CN 201410738311 A CN201410738311 A CN 201410738311A CN 104461918 A CN104461918 A CN 104461918A
- Authority
- CN
- China
- Prior art keywords
- memory block
- node
- memory
- chained list
- dynamically
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Memory System (AREA)
Abstract
The invention provides a method and system for performing statistic operation on dynamically-applied memory blocks. The method comprises the following steps: establishing a chain table formed by a node set, wherein the data structure of each node comprises the following member information of a dynamically-applied memory block: size, num, total, taskId, preNum and next; traversing a memory, and when a memory block which is dynamically applied from the memory is detected, checking whether a node which has the same attribute as the detected memory block exists in the chain table; if the node does not exist, adding the node which has the same attribute as the detected memory block into the chain table; if the node exists, updating the information of the node; after traversing the memory, deleting updated nodes in the chain table; outputting a statistical result of the chain table. Through the method and the system, accurate statistic operation on the dynamically-applied memory blocks is achieved according to memory tasks or the memory size, so that use condition information of the memory is provided for research and development personnel, and developers are effectively helped to narrow the memory problem positioning scope.
Description
Technical field
The invention belongs to field of computer technology, relate to a kind of statistical method and system of memory block, particularly relate to a kind of method and system that the memory block of dynamically application is added up.
Background technology
Vxworks operating system is a kind of embedded real-time operating system (RTOS) that U.S. Wen Ruier (WindRiver) company designed and developed in nineteen eighty-three, is the key components of embedded-development environment.The User Exploitation environment of good sustainable development capacity, high performance kernel and close friend, occupies one seat in embedded real-time operating system field.VxWorks supports the embedded type CPU in nearly all modern market, comprises x86 series, MIPS, PowerPC, Freescale ColdFire, Inteli960, SPARC, SH-4, ARM, StrongARM and xScaleCPU.It to be widely used in remarkable real-time with its good reliability communicate, military affairs, in the high-quality precision and sophisticated technology such as Aeronautics and Astronautics and the high field of requirement of real-time, as satellite communication, military exercises, trajectory guidance, aircraft navigation etc.On F-16, F/A-18 fighter plane of the U.S., B-2 stealth bombers and Patriot Missile, even connect the Mars probes logged at martian surface in July, 1997, the phoenix Mars probes that in May, 2008 logs on martian surface, the X-47B unmanned plane of first-fly in 2011, the curiosity Mars probes that in August, 2012 logs on martian surface have also all used VxWorks.
The memory management mechanism of VxWorks is mainly dynamically applied for memory partitioning, internal memory and discharges, and free memory block manages, but do not do any management and " interference " to the memory block applied for, therefore VxWorks cannot use the memory management mechanism of self to carry out statistic of classification to the memory block applied for.
Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of method and system of adding up the memory block of dynamically application, during for solving memory block generation leakage in prior art, is difficult to locate the problem that the memory block leaked occurs.
For achieving the above object and other relevant objects, the invention provides a kind of method that the memory block of dynamically application is added up, described the method that the memory block dynamically applied for is added up to be comprised: set up a chained list be made up of the set of node; The data structure body of each node includes the following information about firms of the memory block of dynamically application: size, num, total, taskId, preNum and next; Traversal internal memory, when the memory block of a dynamically application from described internal memory being detected, checks in described chained list whether there is the node identical with the attribute of the memory block detected; If do not exist, then add the node identical with the attribute of the described memory block detected in chained list; If exist, then upgrade the information of described node; After traversal internal memory terminates, delete the node do not upgraded in described chained list; Export the statistics of chained list.
Alternatively, the described memory block method of adding up to dynamically application also comprises: when traveling through internal memory, define with the attribute of the form of key word KEY to memory block; When adding up memory block according to task ID, key word is the memory block size in the data structure body of node; When adding up memory block according to memory block size, key word is the task ID in the data structure body of node.
Alternatively, the described memory block method of adding up to dynamically application also comprises: in the process of statistics exporting chained list, information in the data structure body of node each in chained list is cleared up, scale removal process comprises: by num assignment to preNum, only retains taskId or size in node, preNum and next member; Retain taskId or size, determined by key word KEY; When KEY is taskId, retain taskId, otherwise retain size; By total and be not key word KEY size or taskId reset.
Alternatively, heap memory is saved as in described; Memory block dynamically application from described heap memory of described dynamic application; The internal memory that described chained list uses not dynamically application from described heap memory.
Alternatively, the described memory block method of adding up to dynamically application also comprises: when setting up chained list, by call back function when system creation task, adds in chained list by the node establishing memory block that task ID and task name map corresponding; Wherein, task ID and task name map and automatically generate in system operation.
The present invention also provides a kind of memory block system of adding up to dynamically application, describedly comprises the system that the memory block dynamically applied for is added up: chained list sets up module, sets up a chained list be made up of the set of node; The data structure body of each node includes the following information about firms of the memory block of dynamically application: size, num, total, taskId, preNum and next; Internal memory detection module, sets up module with described chained list and is connected, traversal internal memory, when the memory block of a dynamically application from described internal memory being detected, checks in described chained list whether there is the node identical with the attribute of the memory block detected; Node adds module, being connected, when there is not the node identical with the attribute of the memory block detected, adding the node identical with the attribute of the described memory block detected in chained list with described internal memory detection module; Node update module, is connected with described internal memory detection module, when there is the node identical with the attribute of the memory block detected, upgrades the information of described node; Node deletion module, adds module with described node and is connected respectively with node update module, after traversal internal memory terminates, deletes the node do not upgraded in described chained list; Chained list output module, is connected with described node deletion module, exports the statistics of chained list.
Alternatively, the described memory block system of adding up to dynamically application also comprises: detect and arrange module, be connected with described internal memory detection module, when traversal internal memory, defines with the attribute of the form of key word KEY to memory block; When adding up memory block according to task ID, key word is the memory block size in the data structure body of node; When adding up memory block according to memory block size, key word is the task ID in the data structure body of node.
Alternatively, the described memory block system of adding up to dynamically application also comprises: information cleaning module, be connected with described chained list output module, in the process of statistics exporting chained list, information in the data structure body of node each in chained list is cleared up, scale removal process comprises: by num assignment to preNum, only retains taskId or size in node, preNum and next member; Retain taskId or size, determined by key word KEY; When KEY is taskId, retain taskId, otherwise retain size; By total and be not key word KEY size or taskId reset.
Alternatively, heap memory is saved as in described; Memory block dynamically application from described heap memory of described dynamic application; The internal memory that described chained list uses not dynamically application from described heap memory.
Alternatively, the described memory block system of adding up to dynamically application also comprises: task name maps node and adds module, set up module with described chained list to be connected, when setting up chained list, by call back function when system creation task, the node establishing memory block that task ID and task name map corresponding is added in chained list; Wherein, task ID and task name map and automatically generate in system operation.
As mentioned above, method and system of adding up the memory block of dynamically application of the present invention, have following beneficial effect:
Present invention achieves the memory block to dynamically application according to internal memory task or memory size to add up accurately, provide the information of internal memory service condition to research staff, can effectively help developer to reduce the scope of memory problem location.
Accompanying drawing explanation
Fig. 1 is a kind of realization flow schematic diagram to the method that the memory block of dynamically application is added up described in the embodiment of the present invention.
Fig. 2 is the another kind of realization flow schematic diagram to the method that the memory block of dynamically application is added up described in the embodiment of the present invention.
Fig. 3 is the third realization flow schematic diagram to the method that the memory block of dynamically application is added up described in the embodiment of the present invention.
Fig. 4 is the 4th kind of realization flow schematic diagram to the method that the memory block of dynamically application is added up described in the embodiment of the present invention.
Fig. 5 is for realizing structural representation to the one of system that the memory block of dynamically application is added up described in the embodiment of the present invention.
Fig. 6 is for realizing structural representation to the another kind of system that the memory block of dynamically application is added up described in the embodiment of the present invention.
Fig. 7 realizes structural representation for the third of the memory block system of adding up to dynamically application described in the embodiment of the present invention.
Fig. 8 is for realizing structural representation to the 4th kind of system that the memory block of dynamically application is added up described in the embodiment of the present invention.
Fig. 9 is a kind of according to the statistics of appointed task to its internal memory service condition of embodiment of the present invention realization.
Figure 10 is a kind of according to specifying size to the statistics of its internal memory service condition of embodiment of the present invention realization.
Element numbers explanation
The system that 500 pairs of memory blocks dynamically applied for are added up
510 chained lists set up module
520 internal memory detection modules
530 nodes add module
540 node update module
550 node deletion modules
560 chained list output modules
570 detections arrange module
580 information cleaning modules
590 task name map node and add module
S101 ~ S104 step
S201, S301, S401 step
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this instructions can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this instructions also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.
Refer to accompanying drawing.It should be noted that, the diagram provided in the present embodiment only illustrates basic conception of the present invention in a schematic way, then only the assembly relevant with the present invention is shown in graphic but not component count, shape and size when implementing according to reality is drawn, it is actual when implementing, and the kenel of each assembly, quantity and ratio can be a kind of change arbitrarily, and its assembly layout kenel also may be more complicated.
The present invention is mainly used in research and development field, concerning the research staff of upper strata, when there is memory overflow but be difficult to navigate to the memory block generation leakage belonging to which task or which kind of size of type, use the present invention then can provide the information of internal memory service condition to research staff.Research staff uses the present invention can recognize the situation of change that internal memory uses, and this provides convenience to reducing orientation range.
The invention provides a kind of means by watching internal memory use and situation of change, can effectively help developer to reduce the scope of memory problem location.When system generation memory overflow, but when exploitation or maintainer can only determine the leakage caused by an internal memory in certain task or certain size, use the present invention just can get corresponding information.
Below in conjunction with embodiment and accompanying drawing, the present invention is described in detail.
Embodiment
The present embodiment provides a kind of memory block method of adding up to dynamically application, as shown in Figure 1, describedly to comprise the method that the memory block dynamically applied for is added up:
S101, sets up a chained list be made up of the set of node; The data structure body of each node includes the following information about firms of the memory block (i.e. ALLOC memory block) of dynamically application: size size, quantity num, always size total, task ID taskId, last quantity preNum and point to the pointer next of next node.Such as: the form of the data structure body of node can adopt following form to realize:
S102, traversal internal memory, when the memory block of a dynamically application from described internal memory being detected, checks in described chained list whether there is the node identical with the attribute of the memory block detected; If do not exist, then add the node identical with the attribute of the described memory block detected in chained list; If exist, then upgrade the information of described node.
Traversal internal memory according to subregion, can be searched from the low address of each section (application heap subregion) to high address.Do not need during traversal to detect FREE (free time) memory block, only detect ALLOC memory block.Often detect that an ALLOC memory block all will check in chained list whether have the node that attribute is the same with it.If found that there is, then upgrade the information on this node, if do not had, the node that interpolation one is new on chained list.
Wherein, heap memory is saved as in described; Memory block dynamically application from described heap memory of described dynamic application; The internal memory that described chained list uses not dynamically application from described heap memory.The present embodiment creates the internal memory dynamically application from heap memory that chained list uses, but apply for from an overall Array for structural body.The Array for structural body of the described overall situation and Dram (i.e. the internal memory of dynamic application or heap memory) are not same regions.The present invention is used to statistics Dram, if apply for that from Dram memory headroom will affect statistics.And the Array for structural body of the overall situation is the one section of region of memory allocated in advance, do not belong to Dram space, so can not have an impact to statistics Dram result.Described Dram is exactly the meaning of heap memory.Do like this and can to avoid in statistic processes because dynamically application and releasing memory cause the deviation of part statistics, cannot carry out when heap memory also can be avoided to be about to exhaust adding up or statistic processes makes a mistake.
S103, after traversal internal memory terminates, deletes the node do not upgraded in described chained list.
S104, exports the statistics of chained list.
Further, as shown in Figure 2, the described memory block method of adding up to dynamically application also comprises:
S201, when traveling through internal memory, defines with the attribute of the form of key word KEY to memory block; When adding up memory block according to task ID, key word is the memory block size in the data structure body of node; When adding up memory block according to memory block size, key word is the task ID in the data structure body of node.
The present embodiment can be divided into two to add up interfaces, respectively to specify the size of the task of ALLOC memory block and appointment ALLOC memory block to add up for key word KEY.The two ultimate principle realizing statistics is the same.This data structure can be suitable for this two kinds of measurement types, and versatility is stronger.To two different statistical methods, the key word KEY used when setting up chained list is also just different.During statistics appointment taskId, key word KEY is the size in structure; And during statistics appointment size, key word KEY is the taskId in structure.Such as, when key word KEY is taskId, pCurTaskMemBlock->taskId==pCurHdr-GreatT.G reaT.GTheadGuard just represents that this node is the same with the current ALLOC memory block attribute of detection, now upgrades information on this node.
Further, as shown in Figure 3, the described memory block method of adding up to dynamically application also comprises:
S301, in the process of statistics exporting chained list, clear up the information in the data structure body of node each in chained list, scale removal process comprises: by num assignment to preNum, only retains taskId or size in node, preNum and next member; Retain taskId or size, determined by key word KEY; When KEY is taskId, retain taskId, otherwise retain size; By total and be not key word KEY size or taskId reset.
The object of step S301 to retain each num, when using this interface, just can obtain an increment size RiseNum with num-preNum next time.And other members on node are reset, when being in order to avoid adding up next time, the partial task that may occur does not exist.If some task does not exist next time, corresponding node just need not be retained.Therefore, before exporting after each traversal, all can travel through the node whether having num==0 in chained list, namely in chained list, whether have the node be not updated.If had, illustrate that this task is current and do not use any heap memory, also just there is no need to retain this node.
Further, as shown in Figure 4, the described memory block method of adding up to dynamically application also comprises:
S401, when setting up chained list, by call back function when system creation task, adds in chained list by the node establishing memory block that task ID and task name map corresponding; Wherein, task ID and task name map and automatically generate in system operation.
Step S401 can add up some not to be existed, but still takies the task of some heap memories, also can count the task that task is called NULL accurately.If the task of having is called the task of NULL, and in this statistic processes, use kernel interface taskIdFigure (pCurHdr->headGuard) to judge the validity of the ID of the task belonging to ALLOC memory block, mistake of statistics will occur.
VxWorks memory block head all can preserve the size of current block, so can be realized in original mechanism the function of specifying size (size) to add up, but just need slightly to make an amendment to memory block head to the function that appointed task is added up.One, VxWorks memory block head has 16 bytes, and rear 4 bytes of ALLOC (having applied for) memory block head are reserved.Therefore, these last 4 reserved bytes can be used to preserve task ID, so just can carry out the statistics of memory block according to task ID to the task of specifying.
Protection domain to the method that the memory block of dynamically application is added up of the present invention is not limited to the step execution sequence that the present embodiment is enumerated, and every alternative such as easy steps increase and decrease, order adjustment utilizing principle of the present invention to do all is included in protection scope of the present invention.
The present embodiment also provides a kind of system of adding up the memory block of dynamically application, this system can realize the memory block method of adding up to dynamically application described in the present embodiment, but includes but not limited to the implement device of the method that the memory block of dynamically application is added up the structure to the system that the memory block dynamically applied for is added up that the present embodiment is enumerated described in the present embodiment.
As shown in Figure 5, the described memory block system 500 of adding up to dynamically application comprises: chained list sets up module 510, internal memory detection module 520, and node adds module 530, node update module 540, node deletion module 550, chained list output module 560.
Described chained list is set up module 510 and is set up a chained list be made up of the set of node; The data structure body of each node includes the following information about firms of the memory block of dynamically application: size size, quantity num, total size total, task ID taskId, last quantity preNum and point to the pointer next of next node.Such as: the form of the data structure body of node can adopt following form to realize:
Described internal memory detection module 520 and described chained list are set up module 510 and are connected, traversal internal memory, when the memory block of a dynamically application from described internal memory being detected, check in described chained list whether there is the node identical with the attribute of the memory block detected.According to subregion, can search from the low address of each section (application heap subregion) to high address when described internal memory detection module 520 travels through internal memory.Do not need during traversal to detect FREE (free time) memory block, only detect ALLOC memory block.Often detect that an ALLOC memory block all will check in chained list whether have the node that attribute is the same with it.If found that there is, then upgrade the information on this node, if do not had, the node that interpolation one is new on chained list.Wherein, heap memory is saved as in described; Memory block dynamically application from described heap memory of described dynamic application; The internal memory that described chained list uses not dynamically application from described heap memory.The present embodiment creates the internal memory dynamically application from heap memory that chained list uses, but apply for from an overall Array for structural body.Do like this and can to avoid in statistic processes because dynamically application and releasing memory cause the deviation of part statistics, cannot carry out when heap memory also can be avoided to be about to exhaust adding up or statistic processes makes a mistake.
Described node adds module 530 and is connected with described internal memory detection module 520, when there is not the node identical with the attribute of the memory block detected, adds the node identical with the attribute of the described memory block detected in chained list;
Described node update module 540 is connected with described internal memory detection module 520, when there is the node identical with the attribute of the memory block detected, upgrades the information of described node.
Described node deletion module 550 and described node add module 530 and are connected respectively with node update module 540, after traversal internal memory terminates, delete the node do not upgraded in described chained list.
Described chained list output module 560 is connected with described node deletion module 550, exports the statistics of chained list.
Further, as shown in Figure 6, the described memory block system 500 of adding up to dynamically application also comprises: detect and arrange module 570.Described detection arranges module 570 and is connected with described internal memory detection module 520, when traveling through internal memory, defines with the attribute of the form of key word KEY to memory block; When adding up memory block according to task ID, key word is the memory block size in the data structure body of node; When adding up memory block according to memory block size, key word is the task ID in the data structure body of node.The present embodiment can be divided into two to add up interfaces, respectively to specify the size of the task of ALLOC memory block and appointment ALLOC memory block to add up for key word KEY.The two ultimate principle realizing statistics is the same.This data structure can be suitable for this two kinds of measurement types, and versatility is stronger.To two different statistical methods, the key word KEY used when setting up chained list is also just different.During statistics appointment taskId, key word KEY is the size in structure; And during statistics appointment size, key word KEY is the taskId in structure.Such as, when key word KEY is taskId, pCurTaskMemBlock->taskId==pCurHdr-GreatT.G reaT.GTheadGuard just represents that this node is the same with the current ALLOC memory block attribute of detection, now upgrades information on this node.
Further, as shown in Figure 7, the described memory block system 500 of adding up to dynamically application also comprises: information cleaning module 580.Described information cleaning module 580 is connected with described chained list output module 560, in the process of statistics exporting chained list, information in the data structure body of node each in chained list is cleared up, scale removal process comprises: by num assignment to preNum, only retains taskId or size in node, preNum and next member; Retain taskId or size, determined by key word KEY; When KEY is taskId, retain taskId, otherwise retain size; By total and be not key word KEY size or taskId reset.The object of described information cleaning module 580 to retain each num, when using this interface, just can obtain an increment size RiseNum with num-preNum next time.And other members on node are reset, when being in order to avoid adding up next time, the partial task that may occur does not exist.If some task does not exist next time, corresponding node just need not be retained.Therefore, before exporting after each traversal, all can travel through the node whether having num==0 in chained list, namely in chained list, whether have the node be not updated.If had, illustrate that this task is current and do not use any heap memory, also just there is no need to retain this node.
Further, as shown in Figure 8, the described memory block system 500 of adding up to dynamically application also comprises: task name maps node and adds module 590.Described task name maps node and adds module 590 and set up module 510 with described chained list and be connected, when setting up chained list, by call back function when system creation task, adds in chained list by node corresponding for the memory block establishing task ID and task name mapping; Wherein, task ID and task name map and automatically generate in system operation.Described task name maps node and adds module 590 and the present embodiment can be made to count some do not exist, but still takies the task of some heap memories, also can count the task that task is called NULL accurately.If the task of having is called the task of NULL, and in this statistic processes, use kernel interface taskIdFigure (pCurHdr->headGuard) to judge the validity of the ID of the task belonging to ALLOC memory block, mistake of statistics will occur.
The present invention uses single-track link table to carry out statistic of classification to memory block information of the same type.A chained list can be set up during statistics, first check whether chained list has corresponding node, if not then add new node, if there has been corresponding node just to upgrade node information.Retain chained list after statistics end of output, but the partial information on node is reset.
The invention solves and ALLOC (be applied, lower with) memory block is carried out to the problem of adding up according to appointed task or appointment (internal memory) size.Direct user of the present invention is the personnel using vxWorks operating system to develop.The present invention can be used as a kind of debugging method auxiliary development personnel positioning problem, also can provide the real-time information of internal memory service condition for developer.Advantage of the present invention has very large use under two kinds of scenes:
1) when system generation memory overflow, and which task developer can only determine but can not determine to be which kind of memory size is when occurring to leak, just can add up memory block according to appointed task, so just can know which kind of memory size of this task leaks.As shown in Figure 9, carry out Memory statistics according to the task ID of specifying, the service condition of various memory size in this task can be obtained.
2) when system generation memory overflow, and developer can only determine certain memory size but when cannot determine which task internal memory occurs to leak, just can add up memory block according to appointment (internal memory) size, so just can know which task there occurs the memory overflow of this size.As shown in Figure 10, the size according to specifying is added up, and can obtain the situation such as inter-related task and usage quantity thereof using this memory size.
Utilize the present invention, research staff only needs the interface that call connected is identical, can be known see whether certain size corresponding or task exist the situation of memory overflow by observation RiseNum.
In sum, the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.
Claims (10)
1. to a memory block method of adding up for dynamically application, it is characterized in that, described the method that the memory block dynamically applied for is added up to be comprised:
Set up a chained list be made up of the set of node; The data structure body of each node includes the following information about firms of the memory block of dynamically application: size, num, total, taskId, preNum and next;
Traversal internal memory, when the memory block of a dynamically application from described internal memory being detected, checks in described chained list whether there is the node identical with the attribute of the memory block detected; If do not exist, then add the node identical with the attribute of the described memory block detected in chained list; If exist, then upgrade the information of described node;
After traversal internal memory terminates, delete the node do not upgraded in described chained list;
Export the statistics of chained list.
2. the memory block method of adding up to dynamically application according to claim 1, is characterized in that, describedly also comprises the method that the memory block dynamically applied for is added up:
When traveling through internal memory, define with the attribute of the form of key word KEY to memory block; When adding up memory block according to task ID, key word is the memory block size in the data structure body of node; When adding up memory block according to memory block size, key word is the task ID in the data structure body of node.
3. the memory block method of adding up to dynamically application according to claim 2, is characterized in that, describedly also comprises the method that the memory block dynamically applied for is added up:
In the process of statistics exporting chained list, clear up the information in the data structure body of node each in chained list, scale removal process comprises: by num assignment to preNum, only retains taskId or size in node, preNum and next member; Retain taskId or size, determined by key word KEY; When KEY is taskId, retain taskId, otherwise retain size; By total and be not key word KEY size or taskId reset.
4. method of adding up the memory block of dynamically application according to claim 1, is characterized in that: save as heap memory in described; Memory block dynamically application from described heap memory of described dynamic application; The internal memory that described chained list uses not dynamically application from described heap memory.
5. the memory block method of adding up to dynamically application according to claim 1, is characterized in that, describedly also comprises the method that the memory block dynamically applied for is added up:
When setting up chained list, by call back function when system creation task, the node establishing memory block that task ID and task name map corresponding is added in chained list; Wherein, task ID and task name map and automatically generate in system operation.
6. to a memory block system of adding up for dynamically application, it is characterized in that, described the system that the memory block dynamically applied for is added up to be comprised:
Chained list sets up module, sets up a chained list be made up of the set of node; The data structure body of each node includes the following information about firms of the memory block of dynamically application: size, num, total, taskId, preNum and next;
Internal memory detection module, sets up module with described chained list and is connected, traversal internal memory, when the memory block of a dynamically application from described internal memory being detected, checks in described chained list whether there is the node identical with the attribute of the memory block detected;
Node adds module, being connected, when there is not the node identical with the attribute of the memory block detected, adding the node identical with the attribute of the described memory block detected in chained list with described internal memory detection module;
Node update module, is connected with described internal memory detection module, when there is the node identical with the attribute of the memory block detected, upgrades the information of described node;
Node deletion module, adds module with described node and is connected respectively with node update module, after traversal internal memory terminates, deletes the node do not upgraded in described chained list;
Chained list output module, is connected with described node deletion module, exports the statistics of chained list.
7. the memory block system of adding up to dynamically application according to claim 6, is characterized in that, describedly also comprises the system that the memory block dynamically applied for is added up:
Detection arranges module, is connected with described internal memory detection module, when traveling through internal memory, defines with the attribute of the form of key word KEY to memory block; When adding up memory block according to task ID, key word is the memory block size in the data structure body of node; When adding up memory block according to memory block size, key word is the task ID in the data structure body of node.
8. the memory block system of adding up to dynamically application according to claim 7, is characterized in that, describedly also comprises the system that the memory block dynamically applied for is added up:
Information cleaning module, be connected with described chained list output module, in the process of statistics exporting chained list, information in the data structure body of node each in chained list is cleared up, scale removal process comprises: by num assignment to preNum, only retains taskId or size in node, preNum and next member; Retain taskId or size, determined by key word KEY; When KEY is taskId, retain taskId, otherwise retain size; By total and be not key word KEY size or taskId reset.
9. system of adding up the memory block of dynamically application according to claim 6, is characterized in that: save as heap memory in described; Memory block dynamically application from described heap memory of described dynamic application; The internal memory that described chained list uses not dynamically application from described heap memory.
10. the memory block system of adding up to dynamically application according to claim 6, is characterized in that, describedly also comprises the system that the memory block dynamically applied for is added up:
Task name maps node and adds module, sets up module be connected with described chained list, when setting up chained list, by call back function when system creation task, adds in chained list by node corresponding for the memory block establishing task ID and task name mapping; Wherein, task ID and task name map and automatically generate in system operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410738311.8A CN104461918A (en) | 2014-12-05 | 2014-12-05 | Method and system for performing statistic operation on dynamically-applied memory blocks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410738311.8A CN104461918A (en) | 2014-12-05 | 2014-12-05 | Method and system for performing statistic operation on dynamically-applied memory blocks |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104461918A true CN104461918A (en) | 2015-03-25 |
Family
ID=52908005
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410738311.8A Pending CN104461918A (en) | 2014-12-05 | 2014-12-05 | Method and system for performing statistic operation on dynamically-applied memory blocks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104461918A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111610908A (en) * | 2019-02-25 | 2020-09-01 | 上海哔哩哔哩科技有限公司 | Method for generating frame diagram, computer equipment and readable storage medium |
CN114265694A (en) * | 2021-12-23 | 2022-04-01 | 国家电网有限公司信息通信分公司 | Memory replacement method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1286429A (en) * | 1999-11-20 | 2001-03-07 | 深圳市中兴通讯股份有限公司 | Test and monitor method for embedded in processor memory |
CN102681938A (en) * | 2012-05-15 | 2012-09-19 | 青岛海信移动通信技术股份有限公司 | Memory leakage detecting method and device |
CN104360954A (en) * | 2014-10-30 | 2015-02-18 | 上海斐讯数据通信技术有限公司 | Applied memory block statistic method and system |
-
2014
- 2014-12-05 CN CN201410738311.8A patent/CN104461918A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1286429A (en) * | 1999-11-20 | 2001-03-07 | 深圳市中兴通讯股份有限公司 | Test and monitor method for embedded in processor memory |
CN102681938A (en) * | 2012-05-15 | 2012-09-19 | 青岛海信移动通信技术股份有限公司 | Memory leakage detecting method and device |
CN104360954A (en) * | 2014-10-30 | 2015-02-18 | 上海斐讯数据通信技术有限公司 | Applied memory block statistic method and system |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111610908A (en) * | 2019-02-25 | 2020-09-01 | 上海哔哩哔哩科技有限公司 | Method for generating frame diagram, computer equipment and readable storage medium |
CN111610908B (en) * | 2019-02-25 | 2021-06-29 | 上海哔哩哔哩科技有限公司 | Method for generating frame diagram, computer equipment and readable storage medium |
CN114265694A (en) * | 2021-12-23 | 2022-04-01 | 国家电网有限公司信息通信分公司 | Memory replacement method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102789416B (en) | Memory fault injection method and simulator thereof for software built-in test (BIT) | |
US9092314B2 (en) | On-the-fly technical support | |
US10360141B2 (en) | Automated application test system | |
US10354031B2 (en) | Information processing by interpenetrating signal transmission channel in design for testability of chip | |
CN111459982A (en) | Data query method and device, terminal device and storage medium | |
CN104298594B (en) | A kind of automatic detection and localization method of source code median calculation mistake | |
US9262305B1 (en) | Simulation observability and control of all hardware and software components of a virtual platform model of an electronics system | |
CN105511881A (en) | General airborne interactive data management method | |
US20200104246A1 (en) | Continuous automation with test suite engine | |
CN105511843A (en) | Application program interface generation method and device | |
CN103577308A (en) | Method for obtaining log files of mobile device | |
CN102866950A (en) | Performance testing method and testing tool for virtual server | |
CN106155833A (en) | A kind of method and apparatus of asynchronous remote copy | |
CN105183542A (en) | Memory management method and system | |
US10572369B2 (en) | Method for testing a control program of a control device in a simulation environment on a computer | |
CN104461918A (en) | Method and system for performing statistic operation on dynamically-applied memory blocks | |
WO2018080735A2 (en) | Method, apparatus and system for automatically performing end-to-end channel mapping for an interconnect | |
US10664637B2 (en) | Testbench restoration based on capture and replay | |
CN103150445B (en) | The method for decomposing of a kind of MATLAB model variable and device | |
CN109582542A (en) | A kind of method of core of embedded system dump | |
Wang et al. | Research on the reliability analysis of the integrated modular avionics system based on the AADL error model | |
CN116432185B (en) | Abnormality detection method and device, readable storage medium and electronic equipment | |
Stoppe et al. | Automated feature localization for dynamically generated SystemC designs | |
CN108205596B (en) | Method for realizing simulation function of serious accident analysis and calculation program of nuclear power plant | |
CN114579466A (en) | Method, device, equipment and medium for constructing test case and code test |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150325 |