CN105700952A - Embedded system memory statistics method and apparatus - Google Patents

Embedded system memory statistics method and apparatus Download PDF

Info

Publication number
CN105700952A
CN105700952A CN201410693337.5A CN201410693337A CN105700952A CN 105700952 A CN105700952 A CN 105700952A CN 201410693337 A CN201410693337 A CN 201410693337A CN 105700952 A CN105700952 A CN 105700952A
Authority
CN
China
Prior art keywords
memory
identification number
embedded system
status information
use status
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
Application number
CN201410693337.5A
Other languages
Chinese (zh)
Inventor
刘东栋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201410693337.5A priority Critical patent/CN105700952A/en
Priority to PCT/CN2015/087709 priority patent/WO2016082591A1/en
Publication of CN105700952A publication Critical patent/CN105700952A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an embedded system memory statistics method. The embedded system memory statistics method comprises the following steps of when an application applies for a memory, obtaining a preset identifier number corresponding to the memory applied by the application and setting usage state information corresponding to the identifier number to be a used state; when the application releases the memory, obtaining a preset identifier number corresponding to the memory released by the application and setting usage state information corresponding to the identifier number to be an unused state; and according to the identifier number corresponding to the usage state information currently set to be the used state, obtaining a memory occupied by an application currently running in an embedded system. The invention furthermore discloses an embedded system memory statistics apparatus. According to the embedded system memory statistics method and apparatus, the memory space occupied by data used for recording a memory occupation state is effectively reduced and extra overhead of the memory space is reduced, so that an available memory of the application in the embedded system is expanded.

Description

Embedded system memory statistical method and device
Technical field
The present invention relates to embedded system technology field, particularly relate to a kind of embedded system memory statistical method and device。
Background technology
At present, owing to embedded system has the advantage such as reliability and real-time, embedded system is widely used to every field。
Internal memory is the main place that the application program of embedded system runs, grasp in real time the service condition of embedded memory for the operational efficiency of embedded system it is critical that。It is critical only that of detection memory leak issue can obtain the distribution situation that internal memory uses online, namely can obtain and currently use internal memory by which program is taken。Prior art records the service condition of internal memory typically via recording the file of each piece of internal memory application, line number and stack information etc., but the internal memory shared by data for recording the file of internal memory application, line number and stack information is relatively big, causes the free memory of application program in embedded system too small。
Summary of the invention
Present invention is primarily targeted at a kind of embedded system memory statistical method of offer and device, it is intended to solve the technical problem that the data committed memory space for recording EMS memory occupation situation is bigger。
To achieve these goals, the present invention provides a kind of embedded system memory statistical method, and described embedded system memory statistical method comprises the following steps:
When application program internal memory, obtain the corresponding identification number preset of the internal memory with this application program, and the use status information corresponding with this identification number is set to use state;
When application program releasing memory, obtain the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number is set to unused state;
According to being currently set for using the mark number corresponding to the use status information of state to obtain the internal memory shared by the application program that described embedded system is currently running。
Preferably, described when application program internal memory, obtain the corresponding identification number preset of the internal memory with this application program, and be set to use the step of state and described when application program releasing memory by the use status information corresponding with this identification number, obtain the corresponding identification number preset with the internal memory of this application program release, and also include before the use status information corresponding with this identification number is set to the step of unused state:
According to the regular every piece of memory setting identification number to embedded system of default definition。
Preferably, described basis preset definition rule also include after the step of every piece of memory setting identification number of embedded system:
Create the one-to-one relationship between the use status information of each described identification number memory information corresponding with each described identification number and each piece of internal memory corresponding with each described identification number, wherein, the initial value of corresponding with each described identification number use status information is unused state。
Preferably, described basis is currently set for using the step that the identification number corresponding to use status information of state obtains the currently running internal memory shared by application program of described embedded system to include:
Described corresponding relation is searched and is currently at the use status information using state;
In described corresponding relation, corresponding memory information is obtained according to searching the use status information obtained;
The internal memory shared by the application program that described embedded system is currently running is obtained according to the memory information obtained。
Preferably, described basis also includes after being currently set for the step using the mark number corresponding to use status information of state to obtain the currently running internal memory shared by application program of described embedded system:
After Preset Time, in described corresponding relation, obtain corresponding identification number and memory information according to the use status information that current lookup obtains;
By the use status information of current lookup acquisition, and the identification number and memory information according to the described use state information acquisition searched and obtain sends to default memory module。
Additionally, to achieve these goals, the present invention also provides for a kind of embedded system memory statistic device, and described embedded system memory statistic device includes:
First processing module, for when application program internal memory, obtaining the corresponding identification number preset of the internal memory with this application program, and be set to use state by the use status information corresponding with this identification number;
Second processing module, for when application program releasing memory, obtaining the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number be set to unused state;
Statistical module, for obtaining, according to the mark number corresponding to use status information being currently set for using state, the internal memory shared by application program that described embedded system is currently running。
Preferably, described embedded system memory statistic device also includes:
Module is set, for according to presetting the definition rule every piece of memory setting identification number to embedded system。
Preferably, described embedded system memory statistic device also includes:
Creation module, for creating the one-to-one relationship between the use status information of each described identification number memory information corresponding with each described identification number and each piece of internal memory corresponding with each described identification number, wherein, the initial value of corresponding with each described identification number use status information is unused state。
Preferably, institute's statistical module includes:
Search unit, be currently at, for searching in described corresponding relation, the use status information using state;
Acquiring unit, for obtaining the memory information of correspondence according to the use status information searching acquisition in described corresponding relation;
Statistic unit, for obtaining the internal memory shared by the application program that described embedded system is currently running according to the memory information obtained。
Preferably, described embedded system memory statistic device also includes:
Acquisition module, for, after Preset Time, obtaining corresponding identification number and memory information according to the use status information that current lookup obtains in described corresponding relation;
Sending module, for the use status information obtained by current lookup, and the identification number and memory information according to the described use state information acquisition searched and obtain sends to presetting in memory module。
Embedded system memory statistical method provided by the invention and device, when application program internal memory, obtain the corresponding identification number preset of the internal memory with this application program, and be set to use state by the use status information corresponding with this identification number;When application program releasing memory, obtain the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number is set to unused state;According to being currently set for using the mark number corresponding to the use status information of state to obtain the internal memory shared by the application program that described embedded system is currently running, identification number can adopt integer data, the module level information of internal memory just it is able to record that by identification number, significantly reduce the memory headroom shared by the data occupying situation for recording internal memory, reduce the overhead of memory headroom, thus the free memory of the application program added in embedded system。
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of embedded system memory statistical method first embodiment of the present invention;
Fig. 2 is the schematic flow sheet of embedded system memory statistical method the second embodiment of the present invention;
Fig. 3 is the schematic flow sheet of embedded system memory statistical method the 3rd embodiment of the present invention;
Fig. 4 is the refinement schematic flow sheet of step S30 in Fig. 1;
Fig. 5 is the schematic flow sheet of embedded memory statistical method the 4th embodiment of the present invention;
Fig. 6 is the high-level schematic functional block diagram of embedded system memory statistic device first embodiment of the present invention;
Fig. 7 is the high-level schematic functional block diagram of embedded system memory statistic device the second embodiment of the present invention;
Fig. 8 is the high-level schematic functional block diagram of embedded system memory statistic device the 3rd embodiment of the present invention;
Fig. 9 is the refinement high-level schematic functional block diagram of statistical module in Fig. 6;
Figure 10 is the high-level schematic functional block diagram of embedded system memory statistic device the 4th embodiment of the present invention。
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, are described further with reference to accompanying drawing。
Detailed description of the invention
Should be appreciated that specific embodiment described herein is only in order to explain the present invention, is not intended to limit the present invention。
The present invention provides a kind of embedded system memory statistical method。
With reference to the schematic flow sheet that Fig. 1, Fig. 1 are embedded system memory statistical method first embodiment of the present invention。
In one embodiment, this embedded system memory statistical method comprises the following steps:
Step S10, when application program internal memory, obtains the corresponding identification number preset of the internal memory with this application program, and is set to use state by the use status information corresponding with this identification number;
Step S20, when application program releasing memory, obtains the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number is set to unused state;
In the present embodiment, identification number can be configured according to actual needs, as long as enabling to each identification number can represent one piece of internal memory。Such as, identification number can adopt an integer data to arrange。
Preferably, before application program or releasing memory, first creating memory management header structure (or adopting the memory management header structure in operating system), described memory management header structure includes the identification number field for recording each described identification number, for recording the use mode field of the memory information field of memory information corresponding to each described identification number and the use status information for recording each piece of internal memory corresponding to each described identification number;Then each described identification number be recorded in described identification number field, memory information corresponding for each described identification number be recorded in described memory information field, the use status information of each piece of corresponding for each described identification number internal memory be recorded in described use mode field, wherein, one-to-one relationship is formed between each described identification number of record is corresponding with this identification number in described memory management header structure memory information and the use status information of the internal memory corresponding with this identification number。Wherein, memory information can represent the size and location of internal memory。
When application program internal memory, according to the internal memory that this application program is applied for, obtain the identification number corresponding with the internal memory of application, then again the use status information corresponding with this identification number is set to use state。Manage the use mode field in header structure thereby through audit memory and can obtain the current corresponding occupied identification number of internal memory。
When application program releasing memory, according to the internal memory that this application program discharges, obtain the identification number corresponding with the internal memory of release, then again the use status information corresponding with this identification number is set to unused state。Manage the use mode field in header structure thereby through audit memory and can obtain the current corresponding unappropriated identification number of internal memory。
Step S30, according to being currently set for using the mark number corresponding to the use status information of state to obtain the internal memory shared by the application program that described embedded system is currently running。
When the internal memory that the application program needing statistics embedded system currently running occupies, first all use status informations being currently set for using state in above-mentioned memory management header structure are inquired about, then the use status information obtained according to inquiry searches the identification number of its correspondence in above-mentioned memory management header structure, owing to each identification number can represent one piece of internal memory, the identification number therefore obtained by inquiry can obtain the internal memory that the currently running application program of embedded system occupies;Or the use status information obtained according to inquiry searches the memory information of correspondence in above-mentioned memory management header structure, directly represent memory address and memory size due to memory information, the memory information therefore obtained by lookup can obtain the internal memory that the currently running application program of embedded system occupies。
Embedded system memory statistical method provided by the invention, when application program internal memory, obtains the corresponding identification number preset of the internal memory with this application program, and is set to use state by the use status information corresponding with this identification number;When application program releasing memory, obtain the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number is set to unused state;According to being currently set for using the mark number corresponding to the use status information of state to obtain the internal memory shared by the application program that described embedded system is currently running, identification number can adopt integer data, the module level information of internal memory just it is able to record that by identification number, significantly reduce the memory headroom shared by the data occupying situation for recording internal memory, reduce the overhead of memory headroom, thus the free memory of the application program added in embedded system。
Further, it is the schematic flow sheet of embedded system memory statistical method the second embodiment of the present invention with reference to Fig. 2, Fig. 2, a certain in the present invention or in all embodiments, step S10 and also including before step S20:
Step S40, according to the regular every piece of memory setting identification number to embedded system of default definition。
In the present embodiment, presetting definition rule can be configured according to actual needs, as long as enabling to each identification number to represent one piece of internal memory。Preferably, described identification number adopts unsigned int data, and each identification number can represent one piece of internal memory of embedded system。Specifically, the present embodiment adopts 32 integer numbers to illustrate for identification number, and identification number can be divided into three sections, and starting front 8 bits from upper byte is first paragraph, represents the previous module of internal memory user or releaser, represents and ranges for 0 to 255, and 0 value retains;Second segment is 12 bits, represents two grades of modules of internal memory user or releaser, represents and ranges for 1 to 4095;Remaining 12 bits being positioned at low byte are the 3rd section, represent the 3-level module of internal memory user or releaser, wherein, 3-level module can also be further divided into two sections, represent that the module memory that more refines uses position, for instance, the 3rd section can be divided into 4 bits and 8 bits two sections, represent submodule number and submodule bias internal respectively, scope respectively 1 to 255 and 1 to 15。By adopting integer data to arrange identification number, therefore the memory headroom shared by the data occupying situation for recording internal memory is effectively further reduced, reduce the overhead of memory headroom, thus the free memory of the application program added in embedded system。
Further, it is the schematic flow sheet of embedded system memory statistical method the 3rd embodiment of the present invention with reference to Fig. 3, Fig. 3, a certain in the present invention or so in embodiment, also including after step S40:
Step S50, create the one-to-one relationship between the use status information of each described identification number memory information corresponding with each described identification number and each piece of internal memory corresponding with each described identification number, wherein, the initial value of corresponding with each described identification number use status information is unused state。
In the present embodiment, by the use status information of the memory information of memory block representated by identification number, this identification number, the memory block representated by this identification number is set up one-to-one relationship, so that system is according to the identification number and the memory information that use status information can inquire about correspondence。
Preferably, can by above-mentioned memory management header structure represent above-mentioned corresponding relation, memory management header structure include the identification number field for recording each described identification number, for recording the use mode field of the memory information field of memory information corresponding to each described identification number and the use status information for recording each piece of internal memory corresponding to each described identification number;By each described identification number be recorded in described identification number field, memory information corresponding for each described identification number be recorded in described memory information field, the use status information of each piece of corresponding for each described identification number internal memory be recorded in described use mode field, wherein, the each described identification number of record in described memory management header structure, the memory information corresponding with this identification number, and between the use status information of the internal memory corresponding with this identification number, form one-to-one relationship, thus system can obtain the internal memory shared by application program of this embedded system by inquiring about this memory management header structure, therefore the memory headroom shared by the data occupying situation for recording internal memory is effectively further reduced, reduce the overhead of memory headroom, thus the free memory of the application program added in embedded system。
Further, it is the refinement schematic flow sheet of step S30 in Fig. 1 with reference to Fig. 4, Fig. 4, a certain in the present invention or in all embodiments, step S30 includes:
Step S31, searches in described corresponding relation and is currently at the use status information using state;
In the present embodiment, by inquiring about the use mode field in above-mentioned memory management header structure, namely search and be currently set for using the use status information of state。
Step S32, obtains corresponding memory information according to searching the use status information obtained in described corresponding relation;
In the present embodiment, for searching the current use status information being to have used state obtained in step S31, by searching the memory information corresponding with this use status information in above-mentioned memory management header structure, namely obtain and be currently at the memory information using state。
Step S33, obtains the internal memory shared by the application program that described embedded system is currently running according to the memory information obtained。
In the present embodiment, the memory information obtained in step S32 is added up, owing to memory information includes memory size, therefore by being overlapped by the memory size representated by each memory information, the internal memory shared by the application program that embedded system is currently running can be obtained。
Further, in order to reduce the memory headroom shared by the data occupying situation for recording internal memory further, reduce the overhead of memory headroom, thus the free memory of the application program increased in embedded system, with reference to Fig. 5, Fig. 5 is the schematic flow sheet of embedded memory statistical method the 4th embodiment of the present invention, a certain in the present invention or in all embodiments, also includes after step S30:
Step S60, after Preset Time, obtains corresponding identification number and memory information according to the use status information that current lookup obtains in described corresponding relation;
Step S70, the use status information obtained by current lookup, and the identification number and memory information according to the described use state information acquisition searched and obtain send to presetting in memory module。
In the present embodiment, Preset Time can be configured according to actual needs。Default memory module can be one piece of internal memory in embedded system, it is also possible to for External memory equipment, specifically can be configured according to actual needs。
When Preset Time, then by current lookup obtain be in the use status information the using state identification number corresponding with this use status information and memory information all sends to above-mentioned default memory module。
If the number of times that default storage device continues to receive a certain identification number continues to increase, or during more than a certain default value, then it is believed that described embedded system occurs in that memory overflow situation, it is necessary to process in time。
The present embodiment is by sending the statistical information being in the internal memory using state to presetting in memory module termly, thus user by checking that the statistical information in default memory module can obtain embedded system current memory and take situation, and can determine whether whether current embedded system occurs in that memory overflow situation。
The present invention further provides a kind of embedded system memory statistic device。
With reference to the high-level schematic functional block diagram that Fig. 6, Fig. 6 are embedded system memory statistic device first embodiment of the present invention,
In one embodiment, this embedded system memory statistic device includes:
First processing module 10, for when application program internal memory, obtaining the corresponding identification number preset of the internal memory with this application program, and be set to use state by the use status information corresponding with this identification number;
Second processing module 20, for when application program releasing memory, obtaining the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number be set to unused state;
In the present embodiment, identification number can be configured according to actual needs, as long as enabling to each identification number can represent one piece of internal memory。Such as, identification number can adopt an integer data to arrange。
Preferably, before application program or releasing memory, first creating memory management header structure (or adopting the memory management header structure in operating system), described memory management header structure includes the identification number field for recording each described identification number, for recording the use mode field of the memory information field of memory information corresponding to each described identification number and the use status information for recording each piece of internal memory corresponding to each described identification number;Then each described identification number be recorded in described identification number field, memory information corresponding for each described identification number be recorded in described memory information field, the use status information of each piece of corresponding for each described identification number internal memory be recorded in described use mode field, wherein, one-to-one relationship is formed between each described identification number of record is corresponding with this identification number in described memory management header structure memory information and the use status information of the internal memory corresponding with this identification number。Wherein, memory information can represent the size and location of internal memory。
When application program internal memory, according to the internal memory that this application program is applied for, obtain the identification number corresponding with the internal memory of application, then again the use status information corresponding with this identification number is set to use state。Manage the use mode field in header structure thereby through audit memory and can obtain the current corresponding occupied identification number of internal memory。
When application program releasing memory, according to the internal memory that this application program discharges, obtain the identification number corresponding with the internal memory of release, then again the use status information corresponding with this identification number is set to unused state。Manage the use mode field in header structure thereby through audit memory and can obtain the current corresponding unappropriated identification number of internal memory。
Statistical module 30, for obtaining, according to the mark number corresponding to use status information being currently set for using state, the internal memory shared by application program that described embedded system is currently running。
When the internal memory that the application program needing statistics embedded system currently running occupies, first all use status informations being currently set for using state in above-mentioned memory management header structure are inquired about, then the use status information obtained according to inquiry searches the identification number of its correspondence in above-mentioned memory management header structure, owing to each identification number can represent one piece of internal memory, the identification number therefore obtained by inquiry can obtain the internal memory that the currently running application program of embedded system occupies;Or the use status information obtained according to inquiry searches the memory information of correspondence in above-mentioned memory management header structure, directly represent memory address and memory size due to memory information, the memory information therefore obtained by lookup can obtain the internal memory that the currently running application program of embedded system occupies。
Embedded system memory statistic device provided by the invention, when application program internal memory, obtains the corresponding identification number preset of the internal memory with this application program, and is set to use state by the use status information corresponding with this identification number;When application program releasing memory, obtain the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number is set to unused state;According to being currently set for using the mark number corresponding to the use status information of state to obtain the internal memory shared by the application program that described embedded system is currently running, identification number can adopt integer data, the module level information of internal memory just it is able to record that by identification number, significantly reduce the memory headroom shared by the data occupying situation for recording internal memory, reduce the overhead of memory headroom, thus the free memory of the application program added in embedded system。
Further, it is the high-level schematic functional block diagram of embedded system memory statistic device the second embodiment of the present invention with reference to Fig. 7, Fig. 7, a certain in the present invention or in all embodiments, described embedded system memory statistic device also includes:
Module 40 is set, for according to presetting the definition rule every piece of memory setting identification number to embedded system。
In the present embodiment, presetting definition rule can be configured according to actual needs, as long as enabling to each identification number to represent one piece of internal memory。Preferably, described identification number adopts unsigned int data, and each identification number can represent one piece of internal memory of embedded system。Specifically, the present embodiment adopts 32 integer numbers to illustrate for identification number, and identification number can be divided into three sections, and starting front 8 bits from upper byte is first paragraph, represents the previous module of internal memory user or releaser, represents and ranges for 0 to 255, and 0 value retains;Second segment is 12 bits, represents two grades of modules of internal memory user or releaser, represents and ranges for 1 to 4095;Remaining 12 bits being positioned at low byte are the 3rd section, represent the 3-level module of internal memory user or releaser, wherein, 3-level module can also be further divided into two sections, represent that the module memory that more refines uses position, for instance, the 3rd section can be divided into 4 bits and 8 bits two sections, represent submodule number and submodule bias internal respectively, scope respectively 1 to 255 and 1 to 15。By adopting integer data to arrange identification number, therefore the memory headroom shared by the data occupying situation for recording internal memory is effectively further reduced, reduce the overhead of memory headroom, thus the free memory of the application program added in embedded system。
Further, it is the high-level schematic functional block diagram of embedded system memory statistic device the 3rd embodiment of the present invention with reference to Fig. 8, Fig. 8, a certain in the present invention or so in embodiment, described embedded system memory statistic device also includes:
Creation module 50, for creating the one-to-one relationship between the use status information of each described identification number memory information corresponding with each described identification number and each piece of internal memory corresponding with each described identification number, wherein, the initial value of corresponding with each described identification number use status information is unused state。
In the present embodiment, by the use status information of the memory information of memory block representated by identification number, this identification number, the memory block representated by this identification number is set up one-to-one relationship, so that system is according to the identification number and the memory information that use status information can inquire about correspondence。
Preferably, can by above-mentioned memory management header structure represent above-mentioned corresponding relation, memory management header structure include the identification number field for recording each described identification number, for recording the use mode field of the memory information field of memory information corresponding to each described identification number and the use status information for recording each piece of internal memory corresponding to each described identification number;By each described identification number be recorded in described identification number field, memory information corresponding for each described identification number be recorded in described memory information field, the use status information of each piece of corresponding for each described identification number internal memory be recorded in described use mode field, wherein, the each described identification number of record in described memory management header structure, the memory information corresponding with this identification number, and between the use status information of the internal memory corresponding with this identification number, form one-to-one relationship, thus system can obtain the internal memory shared by application program of this embedded system by inquiring about this memory management header structure, therefore the memory headroom shared by the data occupying situation for recording internal memory is effectively further reduced, reduce the overhead of memory headroom, thus the free memory of the application program added in embedded system。
Further, it is the refinement high-level schematic functional block diagram of statistical module in Fig. 6 with reference to Fig. 9, Fig. 9, a certain in the present invention or in all embodiments, institute's statistical module 30 includes:
Search unit 31, be currently at, for searching in described corresponding relation, the use status information using state;
In the present embodiment, by inquiring about the use mode field in above-mentioned memory management header structure, namely search and be currently set for using the use status information of state。
Acquiring unit 32, for obtaining the memory information of correspondence according to the use status information searching acquisition in described corresponding relation;
In the present embodiment, for searching the current use status information being to have used state obtained in searching unit 31, by searching the memory information corresponding with this use status information in above-mentioned memory management header structure, namely obtain and be currently at the memory information using state。
Statistic unit 33, for obtaining the internal memory shared by the application program that described embedded system is currently running according to the memory information obtained。
In the present embodiment, the memory information obtained in acquiring unit 32 is added up, owing to memory information includes memory size, therefore by being overlapped by the memory size representated by each memory information, the internal memory shared by the application program that embedded system is currently running can be obtained。
Further, in order to reduce the memory headroom shared by the data occupying situation for recording internal memory further, reduce the overhead of memory headroom, thus the free memory of the application program increased in embedded system, with reference to Figure 10, Figure 10 is the high-level schematic functional block diagram of embedded system memory statistic device the 4th embodiment of the present invention, a certain in the present invention or in all embodiments, described embedded system memory statistic device also includes:
Acquisition module 60, for, after Preset Time, obtaining corresponding identification number and memory information according to the use status information that current lookup obtains in described corresponding relation;
Sending module 70, for the use status information obtained by current lookup, and the identification number and memory information according to the described use state information acquisition searched and obtain sends to presetting in memory module。
In the present embodiment, Preset Time can be configured according to actual needs。Default memory module can be one piece of internal memory in embedded system, it is also possible to for External memory equipment, specifically can be configured according to actual needs。
When Preset Time, then by current lookup obtain be in the use status information the using state identification number corresponding with this use status information and memory information all sends to above-mentioned default memory module。
If the number of times that default storage device continues to receive a certain identification number continues to increase, or during more than a certain default value, then it is believed that described embedded system occurs in that memory overflow situation, it is necessary to process in time。
The present embodiment is by sending the statistical information being in the internal memory using state to presetting in memory module termly, thus user by checking that the statistical information in default memory module can obtain embedded system current memory and take situation, and can determine whether whether current embedded system occurs in that memory overflow situation。
These are only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every equivalent structure utilizing description of the present invention and accompanying drawing content to make or equivalence flow process conversion; or directly or indirectly it is used in other relevant technical fields, all in like manner include in the scope of patent protection of the present invention。

Claims (10)

1. an embedded system memory statistical method, it is characterised in that described embedded system memory statistical method comprises the following steps:
When application program internal memory, obtain the corresponding identification number preset of the internal memory with this application program, and the use status information corresponding with this identification number is set to use state;
When application program releasing memory, obtain the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number is set to unused state;
According to being currently set for using the mark number corresponding to the use status information of state to obtain the internal memory shared by the application program that described embedded system is currently running。
2. embedded system memory statistical method as claimed in claim 1, it is characterized in that, described when application program internal memory, obtain the corresponding identification number preset of the internal memory with this application program, and be set to use the step of state and described when application program releasing memory by the use status information corresponding with this identification number, obtain the corresponding identification number preset with the internal memory of this application program release, and also include before the use status information corresponding with this identification number is set to the step of unused state:
According to the regular every piece of memory setting identification number to embedded system of default definition。
3. embedded system memory statistical method as claimed in claim 2, it is characterised in that described basis is preset definition rule and also included after the step of every piece of memory setting identification number of embedded system:
Create the one-to-one relationship between the use status information of each described identification number memory information corresponding with each described identification number and each piece of internal memory corresponding with each described identification number, wherein, the initial value of corresponding with each described identification number use status information is unused state。
4. embedded system memory statistical method as claimed in claim 3, it is characterized in that, described basis is currently set for using the step that the identification number corresponding to use status information of state obtains the currently running internal memory shared by application program of described embedded system to include:
Described corresponding relation is searched and is currently at the use status information using state;
In described corresponding relation, corresponding memory information is obtained according to searching the use status information obtained;
The internal memory shared by the application program that described embedded system is currently running is obtained according to the memory information obtained。
5. embedded system memory statistical method as claimed in claim 4, it is characterized in that, described basis also includes after being currently set for the step using the mark number corresponding to use status information of state to obtain the currently running internal memory shared by application program of described embedded system:
After Preset Time, in described corresponding relation, obtain corresponding identification number and memory information according to the use status information that current lookup obtains;
By the use status information of current lookup acquisition, and the identification number and memory information according to the described use state information acquisition searched and obtain sends to default memory module。
6. an embedded system memory statistic device, it is characterised in that described embedded system memory statistic device includes:
First processing module, for when application program internal memory, obtaining the corresponding identification number preset of the internal memory with this application program, and be set to use state by the use status information corresponding with this identification number;
Second processing module, for when application program releasing memory, obtaining the corresponding identification number preset with the internal memory of this application program release, and the use status information corresponding with this identification number be set to unused state;
Statistical module, for obtaining, according to the mark number corresponding to use status information being currently set for using state, the internal memory shared by application program that described embedded system is currently running。
7. embedded system memory statistic device as claimed in claim 6, it is characterised in that described embedded system memory statistic device also includes:
Module is set, for according to presetting the definition rule every piece of memory setting identification number to embedded system。
8. embedded system memory statistic device as claimed in claim 7, it is characterised in that described embedded system memory statistic device also includes:
Creation module, for creating the one-to-one relationship between the use status information of each described identification number memory information corresponding with each described identification number and each piece of internal memory corresponding with each described identification number, wherein, the initial value of corresponding with each described identification number use status information is unused state。
9. embedded system memory statistic device as claimed in claim 8, it is characterised in that institute's statistical module includes:
Search unit, be currently at, for searching in described corresponding relation, the use status information using state;
Acquiring unit, for obtaining the memory information of correspondence according to the use status information searching acquisition in described corresponding relation;
Statistic unit, for obtaining the internal memory shared by the application program that described embedded system is currently running according to the memory information obtained。
10. embedded system memory statistic device as claimed in claim 9, it is characterised in that described embedded system memory statistic device also includes:
Acquisition module, for, after Preset Time, obtaining corresponding identification number and memory information according to the use status information that current lookup obtains in described corresponding relation;
Sending module, for the use status information obtained by current lookup, and the identification number and memory information according to the described use state information acquisition searched and obtain sends to presetting in memory module。
CN201410693337.5A 2014-11-26 2014-11-26 Embedded system memory statistics method and apparatus Pending CN105700952A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410693337.5A CN105700952A (en) 2014-11-26 2014-11-26 Embedded system memory statistics method and apparatus
PCT/CN2015/087709 WO2016082591A1 (en) 2014-11-26 2015-08-20 Method and device for embedded system to count memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410693337.5A CN105700952A (en) 2014-11-26 2014-11-26 Embedded system memory statistics method and apparatus

Publications (1)

Publication Number Publication Date
CN105700952A true CN105700952A (en) 2016-06-22

Family

ID=56073548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410693337.5A Pending CN105700952A (en) 2014-11-26 2014-11-26 Embedded system memory statistics method and apparatus

Country Status (2)

Country Link
CN (1) CN105700952A (en)
WO (1) WO2016082591A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111562986B (en) * 2020-05-11 2023-05-16 上海加糖科技有限公司 Memory allocation method, memory allocation device, electronic equipment and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5809558A (en) * 1994-09-29 1998-09-15 Intel Corporation Method and data storage system for storing data in blocks without file reallocation before erasure
CN1570883A (en) * 2003-07-15 2005-01-26 中兴通讯股份有限公司 Dynamic allocation method for non-buffering memory in embedded real-time operating system
US7260815B1 (en) * 2003-06-30 2007-08-21 Vmware, Inc. Method and apparatus for managing registers in a binary translator
CN101382916A (en) * 2007-09-06 2009-03-11 大唐移动通信设备有限公司 Method for managing embedded system memory
CN102495788A (en) * 2011-11-04 2012-06-13 北京星网锐捷网络技术有限公司 Internal storage counting method and device of embedded system
CN103176911A (en) * 2011-12-20 2013-06-26 陕西银河网电科技有限公司 Embedded type software security memory management method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100472459C (en) * 2005-12-08 2009-03-25 中兴通讯股份有限公司 System for automatically releasing applied programe module leaked memory in inlaid system
TWI475385B (en) * 2012-03-14 2015-03-01 Phison Electronics Corp Method of programming memory cells and reading data, memory controller and memory storage device using the same

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5809558A (en) * 1994-09-29 1998-09-15 Intel Corporation Method and data storage system for storing data in blocks without file reallocation before erasure
US7260815B1 (en) * 2003-06-30 2007-08-21 Vmware, Inc. Method and apparatus for managing registers in a binary translator
CN1570883A (en) * 2003-07-15 2005-01-26 中兴通讯股份有限公司 Dynamic allocation method for non-buffering memory in embedded real-time operating system
CN101382916A (en) * 2007-09-06 2009-03-11 大唐移动通信设备有限公司 Method for managing embedded system memory
CN102495788A (en) * 2011-11-04 2012-06-13 北京星网锐捷网络技术有限公司 Internal storage counting method and device of embedded system
CN103176911A (en) * 2011-12-20 2013-06-26 陕西银河网电科技有限公司 Embedded type software security memory management method

Also Published As

Publication number Publication date
WO2016082591A1 (en) 2016-06-02

Similar Documents

Publication Publication Date Title
CN102982141B (en) A kind of method and device realizing distributed data base agency
US9712413B2 (en) Systems and methods for managing computing systems utilizing augmented reality
CN110287696B (en) Detection method, device and equipment for rebound shell process
CN109669622B (en) File management method, file management device, electronic equipment and storage medium
CN104346264A (en) System and method for processing system event logs
CN106095413A (en) The collocation method of a kind of bluetooth driver and device
CN104951481A (en) Method and device for managing database connection
CN109165175A (en) Device identification generation method and device
CN104410511B (en) A kind of server management method and system
CN104391654A (en) Shared disk management method and system
CN104778252A (en) Index storage method and index storage device
CN104951370A (en) Memory management method and device
CN105700952A (en) Embedded system memory statistics method and apparatus
CN109101608A (en) A kind of date storage method, data query method and device
CN104484619A (en) Method for accessing file system of smart card through application module
CN106406771A (en) Log recording method and log recorder
US10210103B2 (en) Method and device for checking validity of memory access
CN106998436B (en) Video backup method and device
CN104407846B (en) Information processing method and device
CN106095505A (en) A kind of method and device of software upgrading
US8990205B2 (en) Data caveats for database tables
CN106130764A (en) A kind of monitor video direct broadcasting room data, services whether can method and system
WO2020102955A1 (en) Monitoring video storage method and apparatus, and video storage device
CN105045937A (en) Data redundancy energy efficiency detection method
JP5150699B2 (en) Failover information management apparatus, storage processing apparatus, and failover control method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160622

WD01 Invention patent application deemed withdrawn after publication