CN105912398A - Memory detection method and device - Google Patents

Memory detection method and device Download PDF

Info

Publication number
CN105912398A
CN105912398A CN201610210654.6A CN201610210654A CN105912398A CN 105912398 A CN105912398 A CN 105912398A CN 201610210654 A CN201610210654 A CN 201610210654A CN 105912398 A CN105912398 A CN 105912398A
Authority
CN
China
Prior art keywords
bitmap
memory
application program
image file
data
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
CN201610210654.6A
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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610210654.6A priority Critical patent/CN105912398A/en
Publication of CN105912398A publication Critical patent/CN105912398A/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]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to memory detection method and device. The memory detection method includes: acquiring a memory snapshot file of an application program when the application program meets a preset condition; extracting bitmap data of at least two bitmaps from the memory snapshot file; comparing the at least two bitmaps according to the bitmap data; and executing a preset reminding operation if identical bitmaps exist in the memory snapshot file. The technical scheme can accurately and quickly position memory leakage problems of the application program due to repeated establishment of bitmap resources, and provides a specific processing target for memory optimization of the application program, improves the efficiency and the accuracy of memory optimization of the application program, reduces unnecessary memory consumption, and improves the use experience of a terminal.

Description

Internal-memory detection method and device
Technical field
It relates to terminal operating system technical field, particularly relate to internal-memory detection method and device.
Background technology
At present, after running a period of time, the free memory of terminal is fewer and feweri, and this is due to operation program Have what RAM leakage caused.Memory overflow also referred to as " storage seepage ", moves with dynamic memory partition function The space that state is opened up, does not discharges after using, and result causes occupying this internal storage location always, until EP (end of program).Program runtime is the longest, takies memory space and gets more and more, and finally uses up all storages Space, whole system is collapsed.
Summary of the invention
Disclosure embodiment provides internal-memory detection method and device.Described technical scheme is as follows:
First aspect according to disclosure embodiment, it is provided that a kind of internal-memory detection method, including:
When application program meets pre-conditioned, obtain the memory image file of described application program;
The data bitmap of at least two bitmaps described in extracting from described memory image file;
According to institute's bit-map data, described at least two bitmaps are compared;
When described memory image file exists identical bitmap, perform to preset and remind operation.
Optionally, the memory image file of the described application program of described acquisition, including:
Call default internal memory debugging routine, generate described application journey according to the internal storage data of described application program The memory image file of sequence, described memory image file is binary format.
Optionally, the described data bitmap extracting at least two bitmaps from described memory image file, bag Include:
Use default memory analysis program, described memory image file is analyzed, extract at least two The data bitmap of bitmap;
Described according to institute's bit-map data, described at least two bitmaps are compared, including:
Use Message Digest 55 that the data bitmap of described at least two bitmaps is compared.
Optionally, described execution is preset and is reminded operation, including:
The data bitmap of described identical bitmap is sent to described default terminal in a binary format;
Or
The data bitmap of described identical bitmap is sent to described default terminal in bitmap format.
Second aspect according to disclosure embodiment, it is provided that a kind of internal memory detection device, including:
Acquisition module, for when application program meets pre-conditioned, obtains the internal memory of described application program Snapshot document;
Extraction module, for described in extraction from the memory image file that described acquisition module obtains at least two The data bitmap of Zhang Weitu;
Comparison module, for the data bitmap that extracts according to described extraction module to described at least two bitmaps Compare;
Prompting module, for obtaining existing in memory image file identical bitmap when described comparison module compares Time, perform to preset and remind operation.
Optionally, described acquisition module, it is used for calling default internal memory debugging routine, according to described application journey The internal storage data of sequence generates the memory image file of described application program, and described memory image file is two to enter Form processed.
Optionally, described extraction module, it is used for using default memory analysis program, to described acquisition module The memory image file obtained is analyzed, and extracts the data bitmap of at least two bitmaps.
Optionally, described comparison module, it is used for using Message Digest 55 that described extraction module is extracted The data bitmap of at least two bitmaps compare;
Optionally, described prompting module includes: send submodule, for by the bitmap of described identical bitmap Data are sent to described default terminal in a binary format;Or by the data bitmap of described identical bitmap with position Bitmap-format is sent to described default terminal.
The third aspect according to disclosure embodiment, it is provided that a kind of internal memory detection device, including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
When application program meets pre-conditioned, obtain the memory image file of described application program;
The data bitmap of at least two bitmaps described in extracting from described memory image file;
According to institute's bit-map data, described at least two bitmaps are compared;
When described memory image file exists identical bitmap, perform to preset and remind operation.
Embodiment of the disclosure that the technical scheme of offer can include following beneficial effect:
In the present embodiment, by obtaining memory image file, the analysis to internal memory snapshot document, in finding Deposit the middle bitmap resource repeating and creating, this application program can be positioned accurately and rapidly because of bitmap resource weight The Memory Leaks created again and cause, for the internal memory optimization of application program, it is provided that clear and definite process Target, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, carry The Experience Degree that high terminal uses.
In another embodiment, with the EMS memory occupation situation to all application programs being currently running It is analyzed, whether these application programs exists because bitmap resource repeats to create in causing to determine Deposit leakage problem, the application program that there is RAM leakage can be positioned accurately and rapidly, improve application journey The efficiency of sequence internal memory optimization and accuracy, reduce unnecessary memory consumption, improves the experience that terminal uses Degree.
In another embodiment, the internal memory of all application programs being currently running can be accounted for It is analyzed by situation, but the application program selecting EMS memory occupation abnormal is analyzed.Such as, application The actual memory occupation value of program A is 150M, exceedes default EMS memory occupation threshold value 100M, then should to this It is analyzed by the EMS memory occupation situation of program A, to determine whether this application A exists because bitmap provides The Memory Leaks that source is repeated to create and caused, there is RAM leakage in location the most accurately and rapidly Application program, improve the efficiency of application program internal memory optimization and accuracy, reduce unnecessary internal memory and disappear Consumption, improves the Experience Degree that terminal uses.
In another embodiment, call default debugging routine and generate the memory image file of application program, Thus follow-up can by analyze memory image file determine application program whether exist because of bitmap resource repeat The Memory Leaks created and cause, can position the application journey that there is RAM leakage accurately and rapidly Sequence, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, improve The Experience Degree that terminal uses.
In another embodiment, by internal memory snapshot document is analyzed, extract its Bitmap corresponding Data.Allow to by analyzing data bitmap the most identical, determine whether application program exists because of position Image resource repeats to create and the Memory Leaks that causes, can position accurately and rapidly and there is internal memory and let out The application program of dew, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary internal memory Consume, improve the Experience Degree that terminal uses.
In another embodiment, the identification to identical bitmap may be used without other algorithms.If internal memory is fast According to file does not exist identical bitmap, the then problem illustrating to there is not RAM leakage.If memory image is civilian Part exists identical bitmap, then illustrates that this application program exists RAM leakage.By to internal memory snapshot document In the identification of identical bitmap, determine whether this application program exists and cause because bitmap resource repeats to create Memory Leaks, there is the application program of RAM leakage in location the most accurately and rapidly, and improving should The efficiency optimized with program internal memory and accuracy, reduce unnecessary memory consumption, improves what terminal used Experience Degree.
In another embodiment, by notifying developer or the problem of the RAM leakage of user own, it is simple to The problem of the RAM leakage repeating to create bitmap resource in developer's optimization application and cause, it is simple to use Family positions the application program that there is RAM leakage accurately and rapidly, improves the effect of application program internal memory optimization Rate and accuracy, reduce unnecessary memory consumption, improves the Experience Degree that terminal uses.
In another embodiment, can directly be sent to the data bitmap of binary format preset terminal, Data bitmap can also be converted into visible bitmap be sent to preset terminal.So, the use of terminal is preset Family can find to repeat in application program to create asking of bitmap resource by the data bitmap received or bitmap Topic, in order to the timely optimization application of developer, reduces unnecessary memory consumption, improves terminal and uses Experience Degree.
It should be appreciated that it is only exemplary and explanatory that above general description and details hereinafter describe , the disclosure can not be limited.
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meet these public affairs The embodiment opened, and for explaining the principle of the disclosure together with description.
Fig. 1 is the flow chart according to a kind of internal-memory detection method shown in an exemplary embodiment.
Fig. 2 is the flow chart according to a kind of internal-memory detection method shown in another exemplary embodiment.
Fig. 3 is the block diagram detecting device according to a kind of internal memory shown in an exemplary embodiment.
Fig. 4 is the block diagram according to the prompting module shown in an exemplary embodiment.
Fig. 5 is the block diagram according to a kind of device for internal memory detection shown in an exemplary embodiment.
Detailed description of the invention
Here will illustrate exemplary embodiment in detail, its example represents in the accompanying drawings.Following retouches Stating when relating to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous and wants Element.Embodiment described in following exemplary embodiment does not represent own consistent with the disclosure Embodiment.On the contrary, they only with as appended claims describes in detail, the disclosure some The example of the apparatus and method that aspect is consistent.
The technical scheme that disclosure embodiment provides, relates to terminal, finds out and is employed program repetition in internal memory The bitmap resource created, for the internal memory optimization of program, it is provided that clear and definite process target.
This terminal can be mobile phone, computer, digital broadcast terminal, messaging devices, game Control station, tablet device, armarium, body-building equipment, personal digital assistant etc. is arbitrary to be had image and knows The equipment of other function.
Fig. 1 is the flow chart according to a kind of internal-memory detection method shown in an exemplary embodiment, such as Fig. 1 institute Showing, internal-memory detection method, in terminal, comprises the following steps:
In step s 11, when application program meets pre-conditioned, obtain the memory image of application program File;
In step s 12, from memory image file, extract the data bitmap of at least two bitmaps;
In step s 13, according to data bitmap, at least two bitmaps are compared;
In step S14, when memory image file exists identical bitmap, perform to preset and remind operation.
Wherein, memory image file, for a completely available copy about internal storage data set, this is copied Shellfish includes the internal storage data reflection at certain time point (time point that copy starts).Snapshot can be it One copy of represented data, it is also possible to be a copy of data.
In the present embodiment, by obtaining memory image file, the analysis to internal memory snapshot document, in finding Deposit the middle bitmap resource repeating and creating, this application program can be positioned accurately and rapidly because of bitmap resource weight The Memory Leaks created again and cause, for the internal memory optimization of application program, it is provided that clear and definite process Target, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, carry The Experience Degree that high terminal uses.
In another embodiment, application program meets pre-conditioned, including: application program is the most Run.
In the present embodiment, the EMS memory occupation situation of all application programs being currently running can be carried out Analyze, to determine that whether there is the internal memory caused because bitmap resource repeats to create in these application programs lets out Dew problem, can position the application program that there is RAM leakage accurately and rapidly, improves in application program Deposit efficiency and the accuracy of optimization, reduce unnecessary memory consumption, improve the Experience Degree that terminal uses.
In another embodiment, application program meets pre-conditioned, also includes: the internal memory of application program Occupation value exceedes predetermined threshold value.
In the present embodiment, can be to the EMS memory occupation situation of all application programs being currently running It is analyzed, but the application program selecting EMS memory occupation abnormal is analyzed.Such as, application A Actual memory occupation value be 150M, exceed default EMS memory occupation threshold value 100M, then to this application program The EMS memory occupation situation of A is analyzed, to determine whether this application A exists because bitmap resource repeats The Memory Leaks created and cause, there is the application of RAM leakage in location the most accurately and rapidly Program, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, carry The Experience Degree that high terminal uses.
In another embodiment, obtain the memory image file of application program, including:
Call default internal memory debugging routine, generate application program according to the internal storage data of described application program Memory image file, memory image file is binary format.
Wherein, when terminal operating system is Android system, presetting internal memory debugging routine can be Android Debug Bridge (adb) instrument, by adb instrument, calls adb shell am dumpheap order, Generate the memory image file of application program.
In the present embodiment, call default debugging routine and generate the memory image file of application program, from then Continue and can determine whether application program exists because bitmap resource repeats to create by analyzing memory image file The Memory Leaks caused, can position the application program that there is RAM leakage accurately and rapidly, carry The efficiency of high application program internal memory optimization and accuracy, reduce unnecessary memory consumption, improves terminal and makes Experience Degree.
In another embodiment, from memory image file, extract the data bitmap of at least two bitmaps, Including:
Use default memory analysis program, internal memory snapshot document is analyzed, extract at least two bitmaps Data bitmap.
Wherein, presetting memory analysis program can be Memory Analyzer Tool (MAT) instrument, Internal memory snapshot document is analyzed, finds out all of bitmap resource in memory image file, with binary system Form preserve.
In the present embodiment, by internal memory snapshot document is analyzed, extract the data that its Bitmap is corresponding. Allow to by analyzing data bitmap the most identical, determine whether application program exists because of bitmap resource weight The Memory Leaks created again and cause, can position the application that there is RAM leakage accurately and rapidly Program, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, carry The Experience Degree that high terminal uses.
In another embodiment, according to data bitmap, at least two bitmaps are compared, including:
Use Message Digest 55 that the data bitmap of at least two bitmaps is compared.
Wherein it is possible to use Message Digest 55 (MD5) that data bitmap is compared, find phase Data bitmap with bitmap.
In the present embodiment, the identification to identical bitmap may be used without other algorithms.If memory image file In there is not identical bitmap, the then problem illustrating to there is not RAM leakage.If memory image file is deposited At identical bitmap, then illustrate that this application program exists RAM leakage.By to identical in internal memory snapshot document The identification of bitmap, determines whether this application program exists the internal memory caused because bitmap resource repeats to create and let out Dew problem, there is the application program of RAM leakage in location the most accurately and rapidly, improves application program The efficiency of internal memory optimization and accuracy, reduce unnecessary memory consumption, improves the Experience Degree that terminal uses.
In another embodiment, when memory image file exists identical bitmap, perform to preset and remind Operation, including performing at least one operation following:
It is sent to the data bitmap of identical bitmap preset terminal;
In this terminal, the data bitmap of identical bitmap is reminded.
Wherein, this default terminal can be the terminal of application developer.When application program exists because of position During the Memory Leaks that image resource repeats to create and causes, the developer of this application program can be reminded, or It is the user reminding this terminal.
In the present embodiment, by notifying developer or the problem of the RAM leakage of user own, it is simple to developer The problem of RAM leakage repeating to create bitmap resource in optimization application and cause, it is simple to user accurately, Quickly locate the application program that there is RAM leakage, improve the efficiency of application program internal memory optimization with accurate Degree, reduces unnecessary memory consumption, improves the Experience Degree that terminal uses.
In another embodiment, it is sent to the data bitmap of identical bitmap preset terminal, including:
It is sent to the data bitmap of identical bitmap in a binary format preset terminal;
Or
It is sent to the data bitmap of identical bitmap in bitmap format preset terminal.
In the present embodiment, can directly be sent to the data bitmap of binary format preset terminal, it is possible to With data bitmap is converted into visible bitmap be sent to preset terminal.So, the user presetting terminal can Find application program to repeat create the problem of bitmap resource with the data bitmap by receiving or bitmap, So that the timely optimization application of developer, reduce unnecessary memory consumption, improve the body that terminal uses Degree of testing.
Hereinafter said method embodiment is specifically described.
Fig. 2 is the flow chart according to a kind of internal-memory detection method shown in another exemplary embodiment, such as figure Shown in 2, the method comprises the following steps:
In the step s 21, the EMS memory occupation value of the application A being currently running is obtained;
In step S22, it is judged that the EMS memory occupation value of application A exceedes predetermined threshold value, if it is, Perform step S23, if it does not, perform step S21;
In step S23, call adb instrument, generate the memory image file of application A, internal memory Snapshot document is binary format.
In step s 24, use MAT instrument, internal memory snapshot document is analyzed, extract at least The data bitmap of two bitmaps, preserves with binary form;
In step s 25, use MD5 that data bitmap is compared;
In step S26, it is judged that whether the memory image file of application A exists the position of identical bitmap Diagram data, if it is, perform step S27, if it does not, terminate;
In step s 27, the data bitmap of identical bitmap is sent to the end of the developer of application A End.
In the present embodiment, by obtaining memory image file, the analysis to internal memory snapshot document, in finding Deposit the middle bitmap resource repeating and creating, this application program can be positioned accurately and rapidly because of bitmap resource weight The Memory Leaks created again and cause, for the internal memory optimization of application program, it is provided that clear and definite process Target, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, carry The Experience Degree that high terminal uses.
Following for disclosure device embodiment, may be used for performing method of disclosure embodiment.
Fig. 3 is the block diagram detecting device according to a kind of internal memory shown in an exemplary embodiment, and this device can With by software, hardware or both be implemented in combination with become the some or all of of electronic equipment.Such as figure Shown in 3, this internal memory detection device includes:
Acquisition module 31, is configured as application program when meeting pre-conditioned, obtains the interior of application program Deposit snapshot document;
Extraction module 32, is configured to extract at least from the memory image file that acquisition module 31 obtains The data bitmap of two bitmaps;
Comparison module 33, is configured to the data bitmap according to extraction module 32 extraction at least two positions Figure compares;
Prompting module 34, is configured as comparison module 33 and compares and obtain there is phase in memory image file During with bitmap, perform to preset and remind operation.
Wherein, memory image file, for a completely available copy about internal storage data set, this is copied Shellfish includes the internal storage data reflection at certain time point (time point that copy starts).Snapshot can be it One copy of represented data, it is also possible to be a copy of data.
In the present embodiment, by obtaining memory image file, the analysis to internal memory snapshot document, in finding Deposit the middle bitmap resource repeating and creating, this application program can be positioned accurately and rapidly because of bitmap resource weight The Memory Leaks created again and cause, for the internal memory optimization of application program, it is provided that clear and definite process Target, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, carry The Experience Degree that high terminal uses.
Optionally, application program meets pre-conditioned, including: application program is currently running.
In the present embodiment, the EMS memory occupation situation of all application programs being currently running can be carried out Analyze, to determine that whether there is the internal memory caused because bitmap resource repeats to create in these application programs lets out Dew problem, can position the application program that there is RAM leakage accurately and rapidly, improves in application program Deposit efficiency and the accuracy of optimization, reduce unnecessary memory consumption, improve the Experience Degree that terminal uses.
Optionally, application program meets pre-conditioned, also includes: the EMS memory occupation value of application program exceedes Predetermined threshold value.
In the present embodiment, can be to the EMS memory occupation situation of all application programs being currently running It is analyzed, but the application program selecting EMS memory occupation abnormal is analyzed.Such as, application A Actual memory occupation value be 150M, exceed default EMS memory occupation threshold value 100M, then to this application program The EMS memory occupation situation of A is analyzed, to determine whether this application A exists because bitmap resource repeats The Memory Leaks created and cause, there is the application of RAM leakage in location the most accurately and rapidly Program, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, carry The Experience Degree that high terminal uses.
Optionally, acquisition module 31, it is configured to call default internal memory debugging routine, according to described application The internal storage data of program generates the memory image file of application program, and memory image file is binary format.
Wherein, when terminal operating system is Android system, presetting internal memory debugging routine can be Android Debug Bridge (adb) instrument, by adb instrument, calls adb shell am dumpheap order, Generate the memory image file of application program.
In the present embodiment, call default debugging routine and generate the memory image file of application program, from then Continue and can determine whether application program exists because bitmap resource repeats to create by analyzing memory image file The Memory Leaks caused, can position the application program that there is RAM leakage accurately and rapidly, carry The efficiency of high application program internal memory optimization and accuracy, reduce unnecessary memory consumption, improves terminal and makes Experience Degree.
Optionally, extraction module 32, it is configured with presetting memory analysis program, to acquisition module 31 The memory image file obtained is analyzed, and extracts the data bitmap of at least two bitmaps.
Wherein, presetting memory analysis program can be Memory Analyzer Tool (MAT) instrument, Internal memory snapshot document is analyzed, finds out all of bitmap resource in memory image file, with binary system Form preserve.
In the present embodiment, by internal memory snapshot document is analyzed, extract the data that its Bitmap is corresponding. Allow to by analyzing data bitmap the most identical, determine whether application program exists because of bitmap resource weight The Memory Leaks created again and cause, can position the application that there is RAM leakage accurately and rapidly Program, improves efficiency and the accuracy of application program internal memory optimization, reduces unnecessary memory consumption, carry The Experience Degree that high terminal uses.
Optionally, comparison module 33, it is configured to use Message Digest 55 that extraction module 32 is carried The data bitmap of at least two bitmaps taken compares.
Wherein it is possible to use Message Digest 55 (MD5) that data bitmap is compared, find phase Data bitmap with bitmap.
In the present embodiment, the identification to identical bitmap may be used without other algorithms.If memory image file In there is not identical bitmap, the then problem illustrating to there is not RAM leakage.If memory image file is deposited At identical bitmap, then illustrate that this application program exists RAM leakage.By to identical in internal memory snapshot document The identification of bitmap, determines whether this application program exists the internal memory caused because bitmap resource repeats to create and let out Dew problem, there is the application program of RAM leakage in location the most accurately and rapidly, improves application program The efficiency of internal memory optimization and accuracy, reduce unnecessary memory consumption, improves the Experience Degree that terminal uses.
Fig. 4 is the block diagram according to the prompting module shown in an exemplary embodiment, as shown in Figure 4, reminds Module 34 includes
Send submodule 41, be configured to be sent to pre-in a binary format by the data bitmap of identical bitmap If terminal;Or be sent in bitmap format preset terminal by the data bitmap of identical bitmap.
Wherein, this default terminal can be the terminal of application developer.When application program exists because of position During the Memory Leaks that image resource repeats to create and causes, the developer of this application program can be reminded, or It is the user reminding this terminal.
In the present embodiment, by notifying developer or the problem of the RAM leakage of user own, it is simple to developer The problem of RAM leakage repeating to create bitmap resource in optimization application and cause, it is simple to user accurately, Quickly locate the application program that there is RAM leakage, improve the efficiency of application program internal memory optimization with accurate Degree, reduces unnecessary memory consumption, improves the Experience Degree that terminal uses.Can be directly by binary system lattice The data bitmap of formula is sent to preset terminal, it is also possible to data bitmap is converted into visible bitmap and is sent to Preset terminal.So, the user presetting terminal can find to answer by the data bitmap received or bitmap By the problem repeating in program to create bitmap resource, in order to the timely optimization application of developer, reduce not Necessary memory consumption, improves the Experience Degree that terminal uses.
The disclosure also provides for a kind of internal memory detection device, including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
When application program meets pre-conditioned, obtain the memory image file of described application program;
The data bitmap of at least two bitmaps described in extracting from described memory image file;
According to institute's bit-map data, described at least two bitmaps are compared;
When described memory image file exists identical bitmap, perform to preset and remind operation.
Fig. 5 is the block diagram according to a kind of device for internal memory detection shown in an exemplary embodiment, should Device is applicable to terminal unit.Such as, device 1700 can be video camera, sound pick-up outfit, mobile phone, Computer, digital broadcast terminal, messaging devices, game console, tablet device, armarium, Body-building equipment, personal digital assistant etc..
Device 1700 can include following one or more assembly: processes assembly 1702, memorizer 1704, Power supply module 1706, multimedia groupware 1708, audio-frequency assembly 1710, input/output (I/O) connects Mouth 1712, sensor cluster 1714, and communications component 1716.
Process assembly 1702 and generally control the integrated operation of device 1700, such as with display, call, The operation that data communication, camera operation and record operation are associated.Process assembly 1702 and can include one Or multiple processor 1720 performs instruction, to complete all or part of step of above-mentioned method.Additionally, Process assembly 1702 and can include one or more module, it is simple to process assembly 1702 and other assemblies it Between mutual.Such as, process assembly 1702 and can include multi-media module, to facilitate multimedia groupware 1708 and process between assembly 1702 mutual.
Memorizer 1704 is configured to store various types of data to support the operation at equipment 1700. The example of these data includes any application program for operation on device 1700 or the instruction of method, Contact data, telephone book data, message, picture, video etc..Memorizer 1704 can be by any class The volatibility of type or non-volatile memory device or combinations thereof realize, such as static random access memory Device (SRAM), Electrically Erasable Read Only Memory (EEPROM), erasable programmable is read-only Memorizer (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic Memorizer, flash memory, disk or CD.
The various assemblies that power supply module 1706 is device 1700 provide electric power.Power supply module 1706 can wrap Include power-supply management system, one or more power supplys, and other generate with for device 1700, manage and distribute The assembly that electric power is associated.
One output interface of offer that multimedia groupware 1708 is included between described device 1700 and user Screen.In certain embodiments, screen can include liquid crystal display (LCD) and touch panel (TP). If screen includes that touch panel, screen may be implemented as touch screen, to receive the input from user Signal.Touch panel includes that one or more touch sensor touches with sensing, slides and on touch panel Gesture.Described touch sensor can not only sense touch or the border of sliding action, but also detects The persistent period relevant to described touch or slide and pressure.In certain embodiments, multimedia group Part 1708 includes a front-facing camera and/or post-positioned pick-up head.When equipment 1700 is in operator scheme, During such as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive many matchmakers of outside Volume data.Each front-facing camera and post-positioned pick-up head can be a fixing optical lens system or tool There are focal length and optical zoom ability.
Audio-frequency assembly 1710 is configured to output and/or input audio signal.Such as, audio-frequency assembly 1710 Including a mike (MIC), when device 1700 is in operator scheme, such as call model, record mould When formula and speech recognition mode, mike is configured to receive external audio signal.The audio frequency letter received Number can be further stored at memorizer 1704 or send via communications component 1716.Implement at some In example, audio-frequency assembly 1710 also includes a speaker, is used for exporting audio signal.
I/O interface 1712 is to process to provide interface between assembly 1702 and peripheral interface module, above-mentioned outside Enclosing interface module can be keyboard, puts striking wheel, button etc..These buttons may include but be not limited to: homepage Button, volume button, start button and locking press button.
Sensor cluster 1714 includes one or more sensor, for providing each side for device 1700 The state estimation in face.Such as, what sensor cluster 1714 can detect equipment 1700 beats opening/closing shape State, the relative localization of assembly, the most described assembly is display and the keypad of device 1700, sensor Assembly 1714 can also detect device 1700 or the position change of 1,700 1 assemblies of device, user and dress Put the presence or absence of 1700 contacts, device 1700 orientation or acceleration/deceleration and the temperature of device 1700 Degree change.Sensor cluster 1714 can include proximity transducer, is configured to do not having any thing The existence of object near detection during reason contact.Sensor cluster 1714 can also include optical sensor, as CMOS or ccd image sensor, for using in imaging applications.In certain embodiments, should Sensor cluster 1714 can also include acceleration transducer, gyro sensor, Magnetic Sensor, pressure Sensor or temperature sensor.
Communications component 1716 is configured to facilitate wired or wireless mode between device 1700 and other equipment Communication.Device 1700 can access wireless network based on communication standard, such as WiFi, 2G or 3G, Or combinations thereof.In one exemplary embodiment, communications component 1716 receives via broadcast channel From broadcast singal or the broadcast related information of external broadcasting management system.In one exemplary embodiment, Described communications component 1716 also includes near-field communication (NFC) module, to promote junction service.Such as, Can be based on RF identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, Ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 1700 can be by one or more application specific integrated circuits (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), able to programme patrol Collect device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor Or other electronic components realize, it is used for performing said method.
In the exemplary embodiment, a kind of non-transitory computer-readable storage including instruction is additionally provided Medium, such as, include the memorizer 1704 of instruction, and above-mentioned instruction can be by the processor 1720 of device 1700 Perform to complete said method.Such as, described non-transitory computer-readable recording medium can be ROM, Random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..
A kind of non-transitory computer-readable recording medium, when the instruction in described storage medium is by device When the processor of 1700 performs so that device 1700 is able to carry out the method for above-mentioned internal memory detection, described Method includes:
When application program meets pre-conditioned, obtain the memory image file of described application program;
The data bitmap of at least two bitmaps described in extracting from described memory image file;
According to institute's bit-map data, described at least two bitmaps are compared;
When described memory image file exists identical bitmap, perform to preset and remind operation.
Optionally, the memory image file of the described application program of described acquisition, including:
Call default internal memory debugging routine, generate described application journey according to the internal storage data of described application program The memory image file of sequence, described memory image file is binary format.
Optionally, the described data bitmap extracting at least two bitmaps from described memory image file, bag Include:
Use default memory analysis program, described memory image file is analyzed, extract at least two The data bitmap of bitmap;
Described according to institute's bit-map data, described at least two bitmaps are compared, including:
Use Message Digest 55 that the data bitmap of described at least two bitmaps is compared.
Optionally, described execution is preset and is reminded operation, including:
The data bitmap of described identical bitmap is sent to described default terminal in a binary format;
Or
The data bitmap of described identical bitmap is sent to described default terminal in bitmap format.
Those skilled in the art, after considering description and putting into practice disclosure disclosed herein, will readily occur to this Other embodiment disclosed.The application is intended to any modification, purposes or the adaptability of the disclosure Change, these modification, purposes or adaptations are followed the general principle of the disclosure and include these public affairs Open undocumented common knowledge in the art or conventional techniques means.Description and embodiments only by Being considered as exemplary, the true scope of the disclosure and spirit are pointed out by claim below.
It should be appreciated that the disclosure be not limited to described above and illustrated in the accompanying drawings accurately Structure, and various modifications and changes can carried out without departing from the scope.The scope of the present disclosure is only by institute Attached claim limits.

Claims (9)

1. an internal-memory detection method, it is characterised in that including:
When application program meets pre-conditioned, obtain the memory image file of described application program;
The data bitmap of at least two bitmaps described in extracting from described memory image file;
According to institute's bit-map data, described at least two bitmaps are compared;
When described memory image file exists identical bitmap, perform to preset and remind operation.
Method the most according to claim 1, it is characterised in that the described application program of described acquisition Memory image file, including:
Call default internal memory debugging routine, generate described application journey according to the internal storage data of described application program The memory image file of sequence, described memory image file is binary format.
Method the most according to claim 2, it is characterised in that described from described memory image file The data bitmap of middle at least two bitmaps of extraction, including:
Use default memory analysis program, described memory image file is analyzed, extract at least two The data bitmap of bitmap;
Described according to institute's bit-map data, described at least two bitmaps are compared, including:
Use Message Digest 55 that the data bitmap of described at least two bitmaps is compared.
Method the most according to claim 1, it is characterised in that described execution is preset and reminded operation, Including:
It is sent to the data bitmap of described identical bitmap in a binary format preset terminal;
Or
It is sent to the data bitmap of described identical bitmap in bitmap format preset terminal.
5. an internal memory detection device, it is characterised in that including:
Acquisition module, for when application program meets pre-conditioned, obtains the internal memory of described application program Snapshot document;
Extraction module, for described in extraction from the memory image file that described acquisition module obtains at least two The data bitmap of Zhang Weitu;
Comparison module, for the data bitmap that extracts according to described extraction module to described at least two bitmaps Compare;
Prompting module, for obtaining existing in memory image file identical bitmap when described comparison module compares Time, perform to preset and remind operation.
Device the most according to claim 5, it is characterised in that
Described acquisition module, is used for calling default internal memory debugging routine, according to the internal memory of described application program The memory image file of application program described in data genaration, described memory image file is binary format.
Device the most according to claim 6, it is characterised in that
Described extraction module, is used for using default memory analysis program, in obtaining described acquisition module Deposit snapshot document to be analyzed, extract the data bitmap of at least two bitmaps;
Described comparison module, is used for use Message Digest 55 to extract described extraction module at least two The data bitmap of Zhang Weitu compares.
Device the most according to claim 15, it is characterised in that described prompting module includes:
Send submodule, described for the data bitmap of described identical bitmap is sent in a binary format Preset terminal;Or the data bitmap of described identical bitmap is sent to described default terminal in bitmap format.
9. an internal memory detection device, it is characterised in that including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
When application program meets pre-conditioned, obtain the memory image file of described application program;
The data bitmap of at least two bitmaps described in extracting from described memory image file;
According to institute's bit-map data, described at least two bitmaps are compared;
When described memory image file exists identical bitmap, perform to preset and remind operation.
CN201610210654.6A 2016-04-06 2016-04-06 Memory detection method and device Pending CN105912398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610210654.6A CN105912398A (en) 2016-04-06 2016-04-06 Memory detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610210654.6A CN105912398A (en) 2016-04-06 2016-04-06 Memory detection method and device

Publications (1)

Publication Number Publication Date
CN105912398A true CN105912398A (en) 2016-08-31

Family

ID=56745464

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610210654.6A Pending CN105912398A (en) 2016-04-06 2016-04-06 Memory detection method and device

Country Status (1)

Country Link
CN (1) CN105912398A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107480047A (en) * 2017-07-13 2017-12-15 珠海金山网络游戏科技有限公司 A kind of method and device of internal memory auto snapshot
CN111639018A (en) * 2019-03-01 2020-09-08 阿里巴巴集团控股有限公司 Memory leak detection method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102262582A (en) * 2010-05-25 2011-11-30 芯讯通无线科技(上海)有限公司 Mobile terminal and method for detecting memory leakage thereof
CN103218307A (en) * 2013-04-18 2013-07-24 海信集团有限公司 Memory management system and memory management method
CN103617129A (en) * 2013-12-10 2014-03-05 中科创达软件股份有限公司 Method and device for processing memory
CN103942750A (en) * 2013-01-17 2014-07-23 腾讯科技(深圳)有限公司 Screen image recording method and device
US20150067639A1 (en) * 2013-08-30 2015-03-05 Apple Inc. Concurrent accesses of dynamically typed object data
CN104516817A (en) * 2012-05-15 2015-04-15 青岛海信移动通信技术股份有限公司 Memory leak detection method and device
CN105224433A (en) * 2014-06-23 2016-01-06 阿里巴巴集团控股有限公司 A kind of internal memory monitoring method and server
CN105373471A (en) * 2014-08-29 2016-03-02 腾讯科技(深圳)有限公司 Detection method and apparatus for memory leak bug

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102262582A (en) * 2010-05-25 2011-11-30 芯讯通无线科技(上海)有限公司 Mobile terminal and method for detecting memory leakage thereof
CN104516817A (en) * 2012-05-15 2015-04-15 青岛海信移动通信技术股份有限公司 Memory leak detection method and device
CN103942750A (en) * 2013-01-17 2014-07-23 腾讯科技(深圳)有限公司 Screen image recording method and device
CN103218307A (en) * 2013-04-18 2013-07-24 海信集团有限公司 Memory management system and memory management method
US20150067639A1 (en) * 2013-08-30 2015-03-05 Apple Inc. Concurrent accesses of dynamically typed object data
CN103617129A (en) * 2013-12-10 2014-03-05 中科创达软件股份有限公司 Method and device for processing memory
CN105224433A (en) * 2014-06-23 2016-01-06 阿里巴巴集团控股有限公司 A kind of internal memory monitoring method and server
CN105373471A (en) * 2014-08-29 2016-03-02 腾讯科技(深圳)有限公司 Detection method and apparatus for memory leak bug

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107480047A (en) * 2017-07-13 2017-12-15 珠海金山网络游戏科技有限公司 A kind of method and device of internal memory auto snapshot
CN111639018A (en) * 2019-03-01 2020-09-08 阿里巴巴集团控股有限公司 Memory leak detection method and device
CN111639018B (en) * 2019-03-01 2023-05-26 阿里巴巴集团控股有限公司 Memory leakage detection method and device

Similar Documents

Publication Publication Date Title
CN106951884B (en) Fingerprint acquisition method and device and electronic equipment
CN106454336B (en) The method and device and terminal that detection terminal camera is blocked
CN106970754A (en) The method and device of screenshotss processing
EP3200125A1 (en) Fingerprint template input method and device
CN105848190A (en) OTA upgrading method and apparatus
CN104035558A (en) Terminal device control method and device
CN105549849A (en) Method and device for processing misoperation instruction
CN106155504A (en) Module awakening method and device
CN104238912A (en) Application control method and application control device
CN107132949B (en) Anti-interference method, device, terminal and storage medium
CN107659717B (en) State detection method, device and storage medium
CN105843503B (en) Using open method, device and terminal device
CN105301183B (en) Detection of Air Quality method and apparatus
CN105045504A (en) Image content extraction method and apparatus
CN105069426A (en) Similar picture determining method and apparatus
CN105487680A (en) Terminal screen capture method and apparatus and terminal
CN105516483A (en) Equipment control method, device and terminal
CN112200040A (en) Occlusion image detection method, device and medium
CN107622189A (en) Optimize the method and apparatus of unlocked by fingerprint
CN104932970A (en) Monitoring method and device of memory leakage
CN106339137A (en) Terminal touch recognition method and device
CN105975305A (en) Operating system event processing method and device as well as terminal
CN105912398A (en) Memory detection method and device
CN105204712A (en) Method and device for displaying icons of folder
CN104573642A (en) Face recognition method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20160831