CN106201358A - A kind of method and device of internal memory garbage reclamation - Google Patents

A kind of method and device of internal memory garbage reclamation Download PDF

Info

Publication number
CN106201358A
CN106201358A CN201610566468.6A CN201610566468A CN106201358A CN 106201358 A CN106201358 A CN 106201358A CN 201610566468 A CN201610566468 A CN 201610566468A CN 106201358 A CN106201358 A CN 106201358A
Authority
CN
China
Prior art keywords
internal memory
display interface
garbage
slip
garbage reclamation
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
CN201610566468.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.)
Meizu Technology Co Ltd
Original Assignee
Meizu Technology 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 Meizu Technology Co Ltd filed Critical Meizu Technology Co Ltd
Priority to CN201610566468.6A priority Critical patent/CN106201358A/en
Publication of CN106201358A publication Critical patent/CN106201358A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0605Improving or facilitating administration, e.g. storage management by facilitating the interaction with a user or administrator
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket

Abstract

The present invention proposes the method and device of a kind of internal memory garbage reclamation, wherein, the method for described internal memory garbage reclamation, including: whether the display interface of detection terminal is in slip halted state;When detecting that described display interface is in slip halted state, perform the operation of internal memory garbage reclamation.Pass through technical scheme, efficiently avoid the terminal Caton phenomenon caused because of virtual machine internal memory garbage collection operation frequently, make the user can browsing list smoothly, it is not necessary to wait, improve the intelligent of terminal operation, thus improve the experience of user.

Description

A kind of method and device of internal memory garbage reclamation
Technical field
The present invention relates to field of terminal technology, in particular to the method and device of a kind of internal memory garbage reclamation.
Background technology
It is a kind of dynamic memory management technology that intelligent garbage reclaims, and it automatically discharges no longer by the object of program reference, Realize resource according to specific internal memory garbage collection algorithms automatically to reclaim.Owing to losing at establishment object and Garbage Collector release When abandoning the memory headroom shared by object, there will be fragment in internal memory, wherein, fragment is allocated to the sky between the memory block of object Not busy internal memory hole.And Garbage Collector is except discharging object useless, it is also possible to remove internal memory record fragment.Defragmentation is by shared Heap memory move on to one end of heap, then will be sorted out again by JVM (Java Virtual Machine, Java Virtual Machine) Memory Allocation gives new object.Additionally, Garbage Collector can also move those also at the object being cited, reduce internal memory with this Fragment.
There are the following problems for method for current internal memory garbage reclamation (Garbage Collection is called for short GC): in real time Property relevant application in, work frequently due to virtual machine, easily cause " card " phenomenon, and this " card " phenomenon can cause sternly The problem of weight,
Such as, user is when browsing the message that some application programs (such as: wechat, QQ) push, and application program is often real Time transmission some news messages, entertainment newses etc., and great majority are to send with the form of picture, to attract user, when with When family receives these message and browses, owing to picture is too much, virtual machine needs ceaselessly to reclaim and browses complete picture, The most usually there will be the situation that user interface is blocked, i.e. " card " phenomenon, thus affect the experience of user.
Therefore, how to avoid the virtual machine terminal Caton phenomenon that internal memory garbage collection operation causes frequently, make the user can With browsing list smoothly, thus the experience promoting user becomes technical problem urgently to be resolved hurrily.
Summary of the invention
The present invention is based on the problems referred to above, it is proposed that a kind of new internal memory rubbish recovering method, efficiently avoid because of Virtual machine internal memory garbage collection operation frequently and the terminal Caton phenomenon that causes.
In view of this, first aspect of the present invention it is proposed a kind of method of internal memory garbage reclamation, including: detection terminal Display interface whether be in slip halted state;When detecting that described display interface is in slip halted state, in performing Deposit the operation of garbage reclamation.
In this technical scheme, by the state of the display interface of detection terminal, and detecting that it is in slip and stops During state, perform the operation of the internal memory garbage reclamation of terminal, can be effectively prevented from because of virtual machine internal memory garbage reclamation frequently Operation and the terminal Caton phenomenon that causes, make the user can browse displays interface swimmingly, it is not necessary to waits, improves terminal operation Intelligent, thus promote the experience of user.
In technique scheme, it is preferable that whether the display interface of described detection terminal is in slip halted state, tool Body includes: judge whether the cumulative time of the slip gesture that described display interface do not receives user reaches Preset Time;When sentencing When the fixed described cumulative time reaches described Preset Time, determine that described display interface is in slip halted state.
In this technical scheme, during by judging slip gesture accumulative that display interface does not receives user's input continuously Between determine the current state of display interface with the magnitude relationship of Preset Time, so, judgement display interface can be effectively improved The accuracy of residing current state, and then internal memory garbage collection operation can be performed on preferably opportunity;Specifically, judgement is worked as Display interface does not receives cumulative time of slip gesture when reaching Preset Time continuously, i.e. more than or equal to time, then can be true Determining display interface and be in slip halted state, i.e. in Preset Time, user's not touch screen to terminal carries out any behaviour that slides Making, wherein, Preset Time should be as the criterion be configured will not judge the current state of display interface by accident, also can with due regard to terminal touch Touch the factor such as susceptiveness of screen, and then improve the intelligent, to promote the experience of user of internal memory garbage reclamation.
In any of the above-described technical scheme, it is preferable that the operation of described execution internal memory garbage reclamation, specifically include: obtain The garbage object of described display interface;The internal memory taken by described garbage object is reclaimed according to default algorithm.
In this technical scheme, when performing the operation of internal memory garbage reclamation, it is necessary first to owning of traversal display interface Object, to obtain all of garbage object of this display interface, and then reclaims by garbage pair according to default algorithm As the internal memory taken, to reach to reclaim internal memory rubbish, the purpose of releasing memory space, thus improve the operational efficiency of terminal, with Time by the judgement of object and screening, only reclaim garbage object, it is to avoid reclaim wrong and to terminal just affect user Often use, further increase the intelligent of internal memory garbage reclamation and accuracy, improve the experience of user.
Wherein, the algorithm preset includes but not limited to: labelling-removing algorithm, replication strategy and labelling-arrangement algorithm, Other any algorithms being capable of internal memory garbage reclamation all should be suitable for this technical scheme, by providing various garbage to reclaim algorithm The mode making recovery garbage object is more diversified, it is ensured that effective enforcement of scheme.
In any of the above-described technical scheme, it is preferable that before the garbage object of the described display interface of described acquisition, Also include: detect the object of described display interface whether up to;When detecting that described object is unreachable, confirm that described object is Garbage object;Store described garbage object.
In this technical scheme, when display interface is not transferred to slip halted state by sliding mode, can be by real time The object of detection display interface whether up to mode confirm garbage object, and store this garbage pair when confirming As, in order to when display interface is in slip halted state, make garbage object be in the determination can being acquired at any time State, and then the memory headroom that release garbage object takies efficiently, it is achieved the high efficiente callback of internal memory rubbish, specifically exist Detect and when object is unreachable, confirmed as garbage object.
In any of the above-described technical scheme, it is preferable that described display interface is list interface.
In this technical scheme, display interface includes but not limited to list interface, showing of the application that other real-times are relevant Show that interface is also applied for this technical scheme.
According to the second aspect of the invention, it is proposed that the device of a kind of internal memory garbage reclamation, including: detection module, it is used for Whether the display interface of detection terminal is in slip halted state;Recycling module, for detecting described when described detection module When display interface is in slip halted state, perform the operation of internal memory garbage reclamation.
In this technical scheme, by the state of the display interface of detection terminal, and detecting that it is in slip and stops During state, perform the operation of the internal memory garbage reclamation of terminal, can be effectively prevented from because of virtual machine internal memory garbage reclamation frequently Operation and the terminal Caton phenomenon that causes, make the user can browse displays interface swimmingly, it is not necessary to waits, improves terminal operation Intelligent, thus promote the experience of user.
In technique scheme, it is preferable that described detection module specifically includes: judge submodule, it is used for judging described Whether the cumulative time of the slip gesture that display interface does not receives user reaches Preset Time;Determine submodule, for working as institute State and judge that submodule judges when the described cumulative time reaches described Preset Time, determine that described display interface is in slip and stops shape State.
In this technical scheme, during by judging slip gesture accumulative that display interface does not receives user's input continuously Between determine the current state of display interface with the magnitude relationship of Preset Time, so, judgement display interface can be effectively improved The accuracy of residing current state, and then internal memory garbage collection operation can be performed on preferably opportunity;Specifically, judgement is worked as Display interface does not receives cumulative time of slip gesture when reaching Preset Time continuously, i.e. more than or equal to time, then can be true Determining display interface and be in slip halted state, i.e. in Preset Time, user's not touch screen to terminal carries out any behaviour that slides Making, wherein, Preset Time should be as the criterion be configured will not judge the current state of display interface by accident, also can with due regard to terminal touch Touch the factor such as susceptiveness of screen, and then improve the intelligent, to promote the experience of user of internal memory garbage reclamation.
In any of the above-described technical scheme, it is preferable that described recycling module specifically includes: obtain submodule, for working as institute State detection module to detect when described display interface is in slip halted state, obtain the garbage pair of described display interface As;Reclaim submodule, for reclaiming the internal memory taken by described garbage object according to default algorithm.
In this technical scheme, when performing the operation of internal memory garbage reclamation, it is necessary first to owning of traversal display interface Object, to obtain all of garbage object of this display interface, and then reclaims by garbage pair according to default algorithm As the internal memory taken, to reach to reclaim internal memory rubbish, the purpose of releasing memory space, thus improve the operational efficiency of terminal, with Time by the judgement of object and screening, only reclaim garbage object, it is to avoid reclaim wrong and to terminal just affect user Often use, further increase the intelligent of internal memory garbage reclamation and accuracy, improve the experience of user.
Wherein, the algorithm preset includes but not limited to: labelling-removing algorithm, replication strategy and labelling-arrangement algorithm, Other any algorithms being capable of internal memory garbage reclamation all should be suitable for this technical scheme, by providing various garbage to reclaim algorithm The mode making recovery garbage object is more diversified, it is ensured that effective enforcement of scheme.
In any of the above-described technical scheme, it is preferable that described recycling module the most also includes: detection sub-module, it is used for Before described acquisition submodule obtains the garbage object of described display interface, whether the object detecting described display interface may be used Reach;Confirm submodule, for when described detection sub-module detects that described object is unreachable, confirm that described object is useless letter Breath object;Sub module stored, is used for storing described garbage object.
In this technical scheme, when display interface is not transferred to slip halted state by sliding mode, can be by real time The object of detection display interface whether up to mode confirm garbage object, and store this garbage pair when confirming As, in order to when display interface is in slip halted state, make garbage object be in the determination can being acquired at any time State, and then the memory headroom that release garbage object takies efficiently, it is achieved the high efficiente callback of internal memory rubbish, specifically exist Detect and when object is unreachable, confirmed as garbage object.
In any of the above-described technical scheme, it is preferable that described display interface is list interface.
In this technical scheme, display interface includes but not limited to list interface, showing of the application that other real-times are relevant Show that interface is also applied for this technical scheme.
According to the third aspect of the invention we, it is proposed that a kind of terminal, including: as according to any one of technique scheme The device of internal memory garbage reclamation, therefore, this terminal has the internal memory garbage reclamation as according to any one of technique scheme All beneficial effects of device, do not repeat them here.
Technical scheme by performing internal memory rubbish when the display interface determining terminal is in slip halted state The operation that rubbish reclaims, the terminal card that can be effectively prevented from causing because of virtual machine internal memory garbage collection operation frequently pauses existing As, make the user can browse displays interface swimmingly, it is not necessary to wait, improve the intelligent of terminal operation, thus improve use The experience at family.
Accompanying drawing explanation
Fig. 1 shows the schematic flow sheet of the method for the internal memory garbage reclamation that one embodiment of the invention provides;
Fig. 2 shows the schematic flow sheet of the method for the internal memory garbage reclamation that another embodiment of the present invention provides;
Fig. 3 shows the method flow signal of the garbage object of the determination display interface that one embodiment of the invention provides Figure;
Fig. 4 shows the structural schematic block diagram of the device of the internal memory garbage reclamation that one embodiment of the invention provides;
Fig. 5 shows the structural schematic block diagram of the detection module shown in Fig. 4;
Fig. 6 shows the structural schematic block diagram of the recycling module shown in Fig. 4.
Detailed description of the invention
In order to the above-mentioned purpose of the present invention, feature and advantage can be more clearly understood that, real with concrete below in conjunction with the accompanying drawings The present invention is further described in detail by mode of executing.It should be noted that in the case of not conflicting, the enforcement of the application Feature in example and embodiment can be mutually combined.
Elaborate a lot of detail in the following description so that fully understanding the present invention, but, the present invention also may be used Implementing to use other to be different from other modes described here, therefore, protection scope of the present invention is not by described below The restriction of specific embodiment.
Below in conjunction with Fig. 1 and Fig. 2, the embodiment of the method for the internal memory garbage reclamation of the present invention is described in detail.
As it is shown in figure 1, the method for the internal memory garbage reclamation provided according to one embodiment of the invention, walk including below scheme Rapid:
Step 102, whether the display interface of detection terminal is in slip halted state.
Step 104, when detecting that described display interface is in slip halted state, performs the behaviour of internal memory garbage reclamation Make.
In embodiments of the present invention, the slip at detection terminal demonstration interface or rolling condition, determine internal memory garbage reclamation Strategy.As, if display interface is sliding mode, not performing internal memory garbage reclamation, display interface is that non-slip state is (the most sliding Dynamic halted state) time, perform internal memory garbage reclamation.Slip described here, refers to the slip of user's browsing list, when slip shape After the browsing list of state stops, carry out internal memory garbage reclamation process.
In this technical scheme, by the state of the display interface of detection terminal, and detecting that it is in slip and stops During state, perform the operation of the internal memory garbage reclamation of terminal, can be effectively prevented from because of virtual machine internal memory garbage reclamation frequently Operation and the terminal Caton phenomenon that causes, make the user can browse displays interface swimmingly, it is not necessary to waits, improves terminal operation Intelligent, thus promote the experience of user.
Further, in this technical scheme, display interface includes but not limited to list interface, and other real-times are relevant The display interface of application is also applied for this technical scheme.
Further, as in figure 2 it is shown, the technical scheme of above-mentioned steps 102 can be realized by following step of implementing, Specifically include:
Step S202, it is judged that whether the cumulative time of the slip gesture that described display interface does not receives user reaches default Time.
Step S204, when judging that the described cumulative time reaches described Preset Time, determines that described display interface is in cunning Dynamic halted state.
In this technical scheme, during by judging slip gesture accumulative that display interface does not receives user's input continuously Between determine the current state of display interface with the magnitude relationship of Preset Time, so, judgement display interface can be effectively improved The accuracy of residing current state, and then internal memory garbage collection operation can be performed on preferably opportunity;Specifically, judgement is worked as Display interface does not receives cumulative time of slip gesture when reaching Preset Time continuously, i.e. more than or equal to time, then can be true Determining display interface and be in slip halted state, i.e. in Preset Time, user's not touch screen to terminal carries out any behaviour that slides Making, wherein, Preset Time should be as the criterion be configured will not judge the current state of display interface by accident, also can with due regard to terminal touch Touch the factor such as susceptiveness of screen, and then improve the intelligent, to promote the experience of user of internal memory garbage reclamation.
Wherein, Preset Time can be that system default value can also be by user's sets itself, such as 30 seconds.
When the operation of the internal memory garbage reclamation performed in above-mentioned steps 104, as in figure 2 it is shown, can be implemented by following Process step in example realizes:
Step S206, obtains the garbage object of described display interface.
Step S208, reclaims the internal memory taken by described garbage object according to default algorithm.
In this technical scheme, when performing the operation of internal memory garbage reclamation, it is necessary first to owning of traversal display interface Object, to obtain all of garbage object of this display interface, and then reclaims by garbage pair according to default algorithm As the internal memory taken, to reach to reclaim internal memory rubbish, the purpose of releasing memory space, thus improve the operational efficiency of terminal, with Time by the judgement of object and screening, only reclaim garbage object, it is to avoid reclaim wrong and to terminal just affect user Often use, further increase the intelligent of internal memory garbage reclamation and accuracy, improve the experience of user.
Wherein, the algorithm preset includes but not limited to: labelling-removing algorithm, replication strategy and labelling-arrangement algorithm, Other any algorithms being capable of internal memory garbage reclamation all should be suitable for this technical scheme, by providing various garbage to reclaim algorithm The mode making recovery garbage object is more diversified, it is ensured that effective enforcement of scheme.
It addition, before step S206 of above-described embodiment, it is also possible to include process step as shown in Figure 3:
S302, detect the object of described display interface whether up to.
S304, when detecting that described object is unreachable, confirms that described object is garbage object.
S306, stores described garbage object.
In this technical scheme, when display interface is not transferred to slip halted state by sliding mode, can be by real time The object of detection display interface whether up to mode confirm garbage object, and store this garbage pair when confirming As, in order to when display interface is in slip halted state, make garbage object be in the determination can being acquired at any time State, and then the memory headroom that release garbage object takies efficiently, it is achieved the high efficiente callback of internal memory rubbish, specifically exist Detect and when object is unreachable, confirmed as garbage object.
Concrete, distribution object can use new keyword, during releasing object, as long as being entered as by object all references Null, program can not be revisited and asks this object, and our this object is called " inaccessible ".Internal memory garbage reclamation of the present invention Scheme use directed graph mode record and management heap in all objects, " inaccessible " object obtained is useless letter Breath object, and real-time storage.
When state interface list being detected is to slide the state stopped, internal memory garbage collection operation is triggered, After receiving triggering message, travel through all of object, obtain all of garbage object, and by removing (mark-sweep) Algorithm, replication strategy, labelling-arrangement algorithm scheduling algorithm, reclaims the memory headroom taken by garbage object.
Above-mentioned steps S302~step S306 can be in the processes before the display interface of terminal is in slip halted state In carry out at any time, naturally it is also possible to after display interface terminal being detected is in slip halted state, obtain display interface Garbage object before carry out.
Fig. 4 shows the structural schematic block diagram of the device of the internal memory garbage reclamation that one embodiment of the invention provides.
As shown in Figure 4, the device 400 of the internal memory garbage reclamation of embodiments of the invention, including: detection module 402 with return Receive module 404.
Wherein, detection module 402, for detecting whether the display interface of terminal is in slip halted state;
Recycling module 404, for when detection module 402 detects that described display interface is in slip halted state, holds The operation of row internal memory garbage reclamation.
In this technical scheme, by the state of the display interface of detection terminal, and detecting that it is in slip and stops During state, perform the operation of the internal memory garbage reclamation of terminal, can be effectively prevented from because of virtual machine internal memory garbage reclamation frequently Operation and the terminal Caton phenomenon that causes, make the user can browse displays interface swimmingly, it is not necessary to waits, improves terminal operation Intelligent, thus promote the experience of user.
Further, in this technical scheme, display interface includes but not limited to list interface, and other real-times are relevant The display interface of application is also applied for this technical scheme.
In technique scheme, it is preferable that as it is shown in figure 5, detection module 402 specifically includes: judge submodule 4022 With determine submodule 4024.
Wherein, it is judged that submodule 4022, for judging that described display interface does not receives the accumulative of the slip gesture of user Whether the time reaches Preset Time;
Determine submodule 4024, for when judging that submodule 4022 judges that the described cumulative time reaches described Preset Time Time, determine that described display interface is in slip halted state.
In this technical scheme, during by judging slip gesture accumulative that display interface does not receives user's input continuously Between determine the current state of display interface with the magnitude relationship of Preset Time, so, judgement display interface can be effectively improved The accuracy of residing current state, and then internal memory garbage collection operation can be performed on preferably opportunity;Specifically, judgement is worked as Display interface does not receives cumulative time of slip gesture when reaching Preset Time continuously, i.e. more than or equal to time, then can be true Determining display interface and be in slip halted state, i.e. in Preset Time, user's not touch screen to terminal carries out any behaviour that slides Making, wherein, Preset Time should be as the criterion be configured will not judge the current state of display interface by accident, also can with due regard to terminal touch Touch the factor such as susceptiveness of screen, and then improve the intelligent, to promote the experience of user of internal memory garbage reclamation.
Wherein, Preset Time can be that system default value can also be by user's sets itself, such as 30 seconds.
In any of the above-described technical scheme, it is preferable that as shown in Figure 6, described recycling module 404 specifically includes: obtain son Module 4040 and recovery submodule 4042.
Wherein, obtain submodule 4040, for detecting that described display interface is in slip and stops shape when detection module 402 During state, obtain the garbage object of described display interface;
Reclaim submodule 4042, for reclaiming the internal memory taken by described garbage object according to default algorithm.
In this technical scheme, when performing the operation of internal memory garbage reclamation, it is necessary first to owning of traversal display interface Object, to obtain all of garbage object of this display interface, and then reclaims by garbage pair according to default algorithm As the internal memory taken, to reach to reclaim internal memory rubbish, the purpose of releasing memory space, thus improve the operational efficiency of terminal, with Time by the judgement of object and screening, only reclaim garbage object, it is to avoid reclaim wrong and to terminal just affect user Often use, further increase the intelligent of internal memory garbage reclamation and accuracy, improve the experience of user.
Wherein, the algorithm preset includes but not limited to: labelling-removing algorithm, replication strategy and labelling-arrangement algorithm, Other any algorithms being capable of internal memory garbage reclamation all should be suitable for this technical scheme, by providing various garbage to reclaim algorithm The mode making recovery garbage object is more diversified, it is ensured that effective enforcement of scheme.
In any of the above-described technical scheme, it is preferable that as shown in Figure 6, described recycling module 404 specifically also includes: detection Submodule 4044, confirmation submodule 4046 and sub module stored 4048.
Wherein, detection sub-module 4044, for obtaining the garbage pair of described display interface at acquisition submodule 4040 As before, detect the object of described display interface whether up to;
Confirming submodule 4046, for when detection sub-module 4044 detects that described object is unreachable, it is described right to confirm As for garbage object;
Sub module stored 4048, is used for storing described garbage object.
In this technical scheme, when display interface is not transferred to slip halted state by sliding mode, can be by real time The object of detection display interface whether up to mode confirm garbage object, and store this garbage pair when confirming As, in order to when display interface is in slip halted state, make garbage object be in the determination can being acquired at any time State, and then the memory headroom that release garbage object takies efficiently, it is achieved the high efficiente callback of internal memory rubbish, specifically exist Detect and when object is unreachable, confirmed as garbage object.
In Fig. 4 to Fig. 6, detection module 402 and recycling module 404 can be CPU (Central Processing Unit, CPU), microprocessor or digital signal processor (Digital Signal Processor, DSP).
As one embodiment of the present of invention, can be by the device of described internal memory garbage reclamation arbitrary in above-described embodiment For terminal, with the operation by performing internal memory garbage reclamation when the display interface determining terminal is in slip halted state, The terminal Caton phenomenon caused because of virtual machine internal memory garbage collection operation frequently can be effectively prevented from, make the user can be suitable Browse displays interface, smooth ground, it is not necessary to wait, improve the intelligent of terminal operation, thus improve the experience of user.
The following detailed description of technical scheme, the step of the method for internal memory garbage reclamation specifically includes:
1, the slip gesture of user's typing is received;
The sensor possessed according to terminal touch screen, receives the slip gesture of user's typing, the interface residing for touch screen Receive the gesture of user's typing, and make corresponding action, such as when browsing list, receive the slip gesture of user Instruction, list also relative to the action making slip.
2, according to the slip gesture of user's typing, the state (sliding mode or halted state) of browsing list is detected in real time, Specifically, after browsing list is transferred to halted state by sliding mode, and in certain threshold range (Preset Time), touch When screen does not receives the slip gesture of user's typing, it may be determined that now browsing list is in the state stopped of sliding, and i.e. stops State, if after list is transferred to halted state by sliding mode, receives the slip gesture of user's typing once more, and browsing list continues Continuing and slide, the most now browsing list is in sliding mode.
3, when state browsing list being detected is slip halted state (halted state), garbage reclamation is carried out, specifically Step is as follows:
(1) garbage object is found
Distribution object uses new (new) keyword;During releasing object, as long as object all references is entered as null (empty), end application can not be revisited and asks this object, i.e. this object is “ Bu Keda ", GC is had by employing All objects in the mode record of figure and management heap (heap), the object of " inaccessible " that obtain is garbage Object, and store in real time.
(2) reclaim the memory headroom taken by garbage object, make this space can be reused by program
When state browsing list being detected is to slide the state stopped, triggering GC, GC receives this information, Travel through all of object, obtain all of garbage object, and by specific algorithm, reclaim and taken by garbage object Memory headroom, described algorithm can include removing (mark-sweep) algorithm, replication strategy, labelling-arrangement algorithm etc..
Technical scheme, on the opportunity occurred as anticipation GC by the state judging browsing list, carries out rubbish Rubbish recycles, and specifically, after the browsing list being in sliding mode stops, carries out garbage reclamation process, effectively Avoid GC frequent operation in virtual machine, the Caton phenomenon that UI is caused, so that user is when browsing list, can be smoothly Check, it is not necessary to wait, be of value to intelligentized realization, improve Consumer's Experience.
Technical scheme is described in detail, by when determining that the display interface of terminal is in cunning above in association with accompanying drawing Perform the operation of internal memory garbage reclamation during dynamic halted state, can be effectively prevented from because virtual machine internal memory garbage reclamation frequently is grasped Make and the terminal Caton phenomenon that causes, make the user can browse displays interface swimmingly, it is not necessary to wait, improve terminal operation Intelligent, thus improve the experience of user.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.All within the spirit and principles in the present invention, that is made any repaiies Change, equivalent, improvement etc., should be included within the scope of the present invention.

Claims (10)

1. the method for an internal memory garbage reclamation, it is characterised in that including:
Whether the display interface of detection terminal is in slip halted state;
When detecting that described display interface is in slip halted state, perform the operation of internal memory garbage reclamation.
The method of internal memory garbage reclamation the most according to claim 1, it is characterised in that the display interface of described detection terminal Whether it is in slip halted state, specifically includes:
Judge whether the cumulative time of the slip gesture that described display interface do not receives user reaches Preset Time;
When judging that the described cumulative time reaches described Preset Time, determine that described display interface is in slip halted state.
The method of internal memory garbage reclamation the most according to claim 1, it is characterised in that described execution internal memory garbage reclamation Operation, specifically includes:
Obtain the garbage object of described display interface;
The internal memory taken by described garbage object is reclaimed according to default algorithm.
The method of internal memory garbage reclamation the most according to claim 3, it is characterised in that at the described display interface of described acquisition Garbage object before, also include:
Detect the object of described display interface whether up to;
When detecting that described object is unreachable, confirm that described object is garbage object;
Store described garbage object.
The method of internal memory garbage reclamation the most according to any one of claim 1 to 4, it is characterised in that described display circle Face is list interface.
6. the device of an internal memory garbage reclamation, it is characterised in that including:
Detection module, for detecting whether the display interface of terminal is in slip halted state;
Recycling module, for when described detection module detects that described display interface is in slip halted state, performs internal memory The operation of garbage reclamation.
The device of internal memory garbage reclamation the most according to claim 6, it is characterised in that described detection module specifically includes:
Judge submodule, for judging whether the cumulative time of slip gesture that described display interface do not receives user reaches pre- If the time;
Determine submodule, for when described judgement submodule judges that the described cumulative time reaches described Preset Time, determining institute State display interface and be in slip halted state.
The device of internal memory garbage reclamation the most according to claim 6, it is characterised in that described recycling module specifically includes:
Obtain submodule, for when described detection module detects that described display interface is in slip halted state, obtain institute State the garbage object of display interface;
Reclaim submodule, for reclaiming the internal memory taken by described garbage object according to default algorithm.
The device of internal memory garbage reclamation the most according to claim 8, it is characterised in that described recycling module the most also wraps Include:
Detection sub-module, before obtain the garbage object of described display interface at described acquisition submodule, detects institute State the object of display interface whether up to;
Confirm submodule, for when described detection sub-module detects that described object is unreachable, confirm that described object is useless Information object;
Sub module stored, is used for storing described garbage object.
10. according to the device of the internal memory garbage reclamation according to any one of claim 6 to 9, it is characterised in that described display circle Face is list interface.
CN201610566468.6A 2016-07-15 2016-07-15 A kind of method and device of internal memory garbage reclamation Pending CN106201358A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610566468.6A CN106201358A (en) 2016-07-15 2016-07-15 A kind of method and device of internal memory garbage reclamation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610566468.6A CN106201358A (en) 2016-07-15 2016-07-15 A kind of method and device of internal memory garbage reclamation

Publications (1)

Publication Number Publication Date
CN106201358A true CN106201358A (en) 2016-12-07

Family

ID=57494100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610566468.6A Pending CN106201358A (en) 2016-07-15 2016-07-15 A kind of method and device of internal memory garbage reclamation

Country Status (1)

Country Link
CN (1) CN106201358A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357650A (en) * 2017-06-06 2017-11-17 武汉斗鱼网络科技有限公司 A kind of automatic method for releasing of internal memory based on picture resource and system
CN111782326A (en) * 2020-06-30 2020-10-16 北京字节跳动网络技术有限公司 Method and device for controlling page refreshing, computer equipment and storage medium
CN112764891A (en) * 2019-10-21 2021-05-07 青岛海信移动通信技术股份有限公司 Electronic terminal and method for controlling application

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100287486A1 (en) * 2009-05-07 2010-11-11 Microsoft Corporation Correction of typographical errors on touch displays
CN104239157A (en) * 2014-08-19 2014-12-24 北京奇虎科技有限公司 Method and device for optimizing and cleaning data of mobile terminal
CN104462264A (en) * 2014-11-21 2015-03-25 北京奇虎科技有限公司 Method and device for clearing junk files in operating system
CN104714895A (en) * 2015-03-23 2015-06-17 努比亚技术有限公司 Mobile terminal and method and device for increasing running speed of mobile terminal
CN105740078A (en) * 2016-01-29 2016-07-06 华为技术有限公司 Memory management method and apparatus, and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100287486A1 (en) * 2009-05-07 2010-11-11 Microsoft Corporation Correction of typographical errors on touch displays
CN104239157A (en) * 2014-08-19 2014-12-24 北京奇虎科技有限公司 Method and device for optimizing and cleaning data of mobile terminal
CN104462264A (en) * 2014-11-21 2015-03-25 北京奇虎科技有限公司 Method and device for clearing junk files in operating system
CN104714895A (en) * 2015-03-23 2015-06-17 努比亚技术有限公司 Mobile terminal and method and device for increasing running speed of mobile terminal
CN105740078A (en) * 2016-01-29 2016-07-06 华为技术有限公司 Memory management method and apparatus, and terminal

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357650A (en) * 2017-06-06 2017-11-17 武汉斗鱼网络科技有限公司 A kind of automatic method for releasing of internal memory based on picture resource and system
CN107357650B (en) * 2017-06-06 2020-12-15 武汉斗鱼网络科技有限公司 Automatic memory release method and system based on picture resources
CN112764891A (en) * 2019-10-21 2021-05-07 青岛海信移动通信技术股份有限公司 Electronic terminal and method for controlling application
CN112764891B (en) * 2019-10-21 2022-11-11 青岛海信移动通信技术股份有限公司 Electronic terminal and method for controlling application
CN111782326A (en) * 2020-06-30 2020-10-16 北京字节跳动网络技术有限公司 Method and device for controlling page refreshing, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106201358A (en) A kind of method and device of internal memory garbage reclamation
CN101908022B (en) Method and device for managing internal memory of mobile communication equipment terminal
CN102799471B (en) Method and system for process recycling of operating system
US10551996B2 (en) Method and apparatus for starting an application in a screen-locked state
CN106956610B (en) Charging pile group power control method and device
CN102047225B (en) Priority controller and priority control method
CN106294206B (en) Cache data processing method and device
EP3432159B1 (en) Garbage collection method and device
CN103777947B (en) The management method at the main interface of a kind of mobile terminal and device
CN103514102A (en) Memory garbage collecting method and device for Java virtual machine
CN105159777A (en) Process memory collection method and apparatus
CN114003488A (en) Memory leak detection method and equipment
CN108008896A (en) Display control method and related product
CN105677150B (en) The data clearing method and device of application program
CN106354659A (en) Method on FLASH resource recovery of embedded device
CN108536609B (en) Memory fragment management system and method
WO2012006920A1 (en) System and method for self-adaptive garbage object collection
CN108255608B (en) Management method of memory pool
US20190065368A1 (en) Memory reclaiming method and apparatus
CN102591788B (en) Method for recovering Java card garbage
CN110968553A (en) Method and device for sorting elements in directory tree
CN111831467A (en) Method, system and electronic equipment for java process memory overflow self-fusing
CN113895828B (en) Control method of mobile robot and related equipment
US6151666A (en) Method for reclaiming fragmented space on a physical data storage cartridge
CN103226476A (en) Garbage object detecting 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

Application publication date: 20161207

RJ01 Rejection of invention patent application after publication