CN104021085A - Mobile terminal internal memory cleaning method and device - Google Patents
Mobile terminal internal memory cleaning method and device Download PDFInfo
- Publication number
- CN104021085A CN104021085A CN201410168542.XA CN201410168542A CN104021085A CN 104021085 A CN104021085 A CN 104021085A CN 201410168542 A CN201410168542 A CN 201410168542A CN 104021085 A CN104021085 A CN 104021085A
- Authority
- CN
- China
- Prior art keywords
- memory
- space
- cleaning
- mobile terminal
- storage space
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000015654 memory Effects 0.000 title claims abstract description 183
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000004140 cleaning Methods 0.000 title claims abstract description 50
- 238000004088 simulation Methods 0.000 claims description 12
- 230000000694 effects Effects 0.000 abstract description 7
- 238000004590 computer program Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a mobile terminal internal memory cleaning method and device. The mobile terminal internal memory cleaning method mainly comprises the following steps that the current occupation conditions of different types of internal memories of a system are acquired, wherein the different types of the internal memories are divided into active memory space occupied by a current program or application, memory space used by the system, non-active memory space storing background non-active progress data and current residual available idle memory space; according to the occupation conditions of the idle memory space and the non-active memory space, the size of internal memory data which need to be written in a simulated mode is calculated; on the basis of the simulated internal memory data, program starting is simulated in a memory pool to carry out internal memory distribution, wherein when internal memory distribution is completed successfully, the internal memory is not written and it is notified that internal memory cleaning is completed successfully, and information of unsuccessful internal memory cleaning is fed back when internal memory distribution fails. According to the mobile terminal internal memory cleaning method and device, the idle memory space is squeezed out in a memory distribution mode, in this way, the system can still operate stably in the internal memory cleaning process, and the effect is good.
Description
Technical Field
The invention belongs to a memory cleaning method and device of a mobile terminal, and particularly relates to a memory cleaning method and device based on an IOS platform.
Background
With the increasing of the common level of the current intelligent machine and the processing performance of the intelligent machine, more and more complex applications log on the intelligent machine. Such as some drawing applications, editors, 3D games, etc. These applications often require large amounts of memory. There are many indications that a flash back may occur upon entry of an application, most likely due to insufficient memory.
Generally, the memory of the mobile terminal is classified into the following four types:
1. active storage space: representing the currently occupied storage space. The part of the storage space is released only after some background active processes are closed or the current process actively releases the memory allocated by the current process.
2. Inactive storage space: this portion of the memory space is used to hold some data of the background inactive process. Thus the operating system can switch processes at the fastest speed.
3. Storage space used fixedly: this portion of the memory space is used by the system and cannot be allocated and freed by the application.
4. Free storage space: indicating the currently remaining available storage space. The total memory space is the sum of the four memory spaces.
For 1 and 3, the memory cannot be cleaned generally, and therefore, the memory spaces which can be cleaned are mainly 2 and 4.
Due to the design of a part of background inactive processes in the inactive storage space, common memory cleaning software cannot completely clean the space, and therefore the cleaning effect is poor.
Disclosure of Invention
The invention aims to provide a complete memory cleaning method and a complete memory cleaning device, which are used for realizing the purpose of quickly and completely cleaning a memory.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a method for cleaning the memory of a mobile terminal comprises the following steps:
acquiring the occupation conditions of different types of memories of the current system;
the different types of the memory are as follows: the method comprises the following steps of occupying an active storage space, a storage space used by a system, an inactive storage space for storing background inactive process data and a current remaining available free storage space by a current program or application;
calculating the size of memory data needing analog writing according to the occupation conditions of the free storage space and the inactive storage active space;
starting a simulation program in a memory pool to perform memory allocation based on the data size of the simulation memory, wherein when the memory allocation is successful, the memory is not written in, and the memory is informed of successful cleaning; and when the memory allocation fails, returning the information of the cleaning failure.
Further, a preferred method is that the system of the mobile terminal is an IOS system.
Further, a preferred method is that the size of the memory data to be subjected to analog writing is: 2/3 size of the free memory space and the inactive memory space.
Further, a preferred method is to acquire the occupation conditions of different types of memories of the current system based on the map table information of the system.
Preferably, the method further comprises the following steps:
and informing the user of the size of the cleared memory while informing that the memory is cleared successfully.
A mobile terminal memory cleaning device comprises:
the memory acquisition unit is used for acquiring the occupation conditions of different types of memories of the current system;
the different types of the memory are as follows: the method comprises the following steps of occupying an active storage space, a storage space used by a system, an inactive storage space for storing background inactive process data and a current remaining available free storage space by a current program or application;
the simulation distribution unit is used for calculating the size of the memory data needing simulation writing according to the occupation conditions of the free storage space and the inactive storage active space;
the space cleaning unit is used for starting memory allocation in a memory pool based on the simulation memory data size simulation program, wherein when the memory allocation is successful, the memory is not written in, and the memory cleaning success is informed; and when the memory allocation fails, returning the information of the cleaning failure.
Further, preferably, the system of the mobile terminal is an IOS system.
Further, preferably, the size of the memory data to be subjected to analog writing is: 2/3 size of the free memory space and the inactive memory space.
Further, preferably, the memory obtaining unit is further configured to obtain occupation statuses of different types of memories of a current system based on map table information of the system.
Further, preferably, the space cleaning unit is further configured to notify the user of the size of the cleaned memory while notifying that the memory cleaning is successful.
After the scheme is adopted, the size of the memory data needing analog writing can be calculated according to the occupation conditions of the free storage space and the inactive storage active space based on the classification of the memory of the mobile terminal, and the analog program is started in the memory pool for memory allocation based on the analog memory data size, so that the problem that the program in the inactive storage active space occupies a cache stubborn in the prior art can be solved, the memory occupation of the system can be better cleared, and the technical effect is better.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The present invention will be described in detail below with reference to the accompanying drawings so that the above advantages of the present invention will be more apparent. Wherein,
FIG. 1 is a diagram illustrating memory classification of a memory cleaning method for a mobile terminal according to the present invention;
FIG. 2 is a flow chart illustrating a method for clearing a memory of a mobile terminal according to the present invention;
fig. 3 is a schematic structural diagram of a mobile terminal memory cleaning device according to the present invention.
Detailed Description
The following detailed description of the embodiments of the present invention will be provided with reference to the drawings and examples, so that how to apply the technical means to solve the technical problems and achieve the technical effects can be fully understood and implemented. It should be noted that, as long as there is no conflict, the embodiments and the features of the embodiments of the present invention may be combined with each other, and the technical solutions formed are within the scope of the present invention.
Additionally, the steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions and, although a logical order is illustrated in the flow charts, in some cases, the steps illustrated or described may be performed in an order different than here.
Specifically, as shown in fig. 1, the memory of the mobile terminal is divided into the following four types:
1. active storage space: representing the currently occupied storage space. The part of the storage space is released only after some background active processes are closed or the current process actively releases the memory allocated by the current process.
2. Inactive storage space: this portion of the memory space is used to hold some data of the background inactive process. Thus the operating system can switch processes at the fastest speed.
3. Storage space used fixedly: this portion of the memory space is used by the system and cannot be allocated and freed by the application.
4. Free storage space: indicating the currently remaining available storage space. The total memory space is the sum of the four memory spaces.
For 1 and 3, the memory cannot be cleaned generally, and therefore, the memory spaces which can be cleaned are mainly 2 and 4.
Due to the design of a part of background inactive processes in the inactive storage space, common memory cleaning software cannot completely clean the space, and therefore the cleaning effect is poor.
As shown in fig. 1, the method for clearing the memory of the mobile terminal of the present invention mainly includes:
step 1: acquiring the occupation conditions of different types of memories of the current system;
the different types of the memory are as follows: the method comprises the following steps of occupying an active storage space, a storage space used by a system, an inactive storage space for storing background inactive process data and a current remaining available free storage space by a current program or application;
step 2: calculating the size of memory data needing analog writing according to the occupation conditions of the free storage space and the inactive storage active space;
and step 3: starting a simulation program in a memory pool to perform memory allocation based on the data size of the simulation memory, wherein when the memory allocation is successful, the memory is not written in, and the memory is informed of successful cleaning; and when the memory allocation fails, returning the information of the cleaning failure.
In the embodiment, the operation is mainly performed under an IOS platform, and preferably, the system of the mobile terminal is an IOS system.
And, in order to guarantee the thorough cleaning of the memory, the size of the memory data of the analog write-in is selected as follows: 2/3 size of the free storage space and the inactive storage space, and in the method, the free storage space is mainly extruded in a storage allocation mode, so that the whole system can still stably run in the memory cleaning process. In addition, the allocation with 2/3 size of free memory space and inactive memory space ensures the stability of the clean up memory application.
That is, when the memory space of 2/3 is cleared, the clearing of the memory is relatively thorough, and besides, as compared with the prior art, the occupation situation of different types of memories of the current system is mainly obtained based on the map table information of the system, which is not described in detail herein.
In order to achieve better cleaning effect and user availability, in step 3, the user is notified of the size of the cleaned memory while the memory is successfully cleaned, so that the user can use the memory conveniently.
That is, in the present invention, the main steps are as follows:
1. and allocating the memory in the current memory pool by using 2/3 of the free storage area + the inactive storage space as the size.
2. If the allocation is successful, the cleaning is successful, and the user is fed back how much space is cleaned.
3. If the allocation fails, a null pointer is returned, indicating a cleaning failure.
Corresponding to the method, the invention also discloses a mobile terminal memory cleaning device, which comprises:
the memory acquisition unit is used for acquiring the occupation conditions of different types of memories of the current system;
the different types of the memory are as follows: the method comprises the following steps of occupying an active storage space, a storage space used by a system, an inactive storage space for storing background inactive process data and a current remaining available free storage space by a current program or application;
the simulation distribution unit is used for calculating the size of the memory data needing simulation writing according to the occupation conditions of the free storage space and the inactive storage active space;
the space cleaning unit is used for starting memory allocation in a memory pool based on the simulation memory data size simulation program, wherein when the memory allocation is successful, the memory is not written in, and the memory cleaning success is informed; and when the memory allocation fails, returning the information of the cleaning failure.
Further, preferably, the system of the mobile terminal is an IOS system.
Further, preferably, the size of the memory data to be subjected to analog writing is: 2/3 size of the free storage space and inactive storage space.
Further, preferably, the memory obtaining unit is further configured to obtain occupation statuses of different types of memories of a current system based on map table information of the system.
Further, preferably, the space cleaning unit is further configured to notify the user of the size of the cleaned memory while notifying that the memory cleaning is successful.
After the scheme is adopted, the size of the memory data needing analog writing can be calculated according to the occupation conditions of the free storage space and the inactive storage active space based on the classification of the memory of the mobile terminal, and the analog program is started in the memory pool for memory allocation based on the analog memory data size, so that the problem that the program in the inactive storage active space occupies a cache stubborn in the prior art can be solved, the memory occupation of the system can be better cleared, and the technical effect is better.
It should be noted that for simplicity of description, the above method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for cleaning the memory of a mobile terminal comprises the following steps:
acquiring the occupation conditions of different types of memories of the current system;
the different types of the memory are as follows: the method comprises the following steps of occupying an active storage space, a storage space used by a system, an inactive storage space for storing background inactive process data and a current remaining available free storage space by a current program or application;
calculating the size of memory data needing analog writing according to the occupation conditions of the free storage space and the inactive storage active space;
starting a simulation program in a memory pool to perform memory allocation based on the data size of the simulation memory, wherein when the memory allocation is successful, the memory is not written in, and the memory is informed of successful cleaning; and when the memory allocation fails, returning the information of the cleaning failure.
2. The method according to claim 1, wherein the system of the mobile terminal is an IOS system.
3. The method according to claim 1 or 2, wherein the size of the memory data to be subjected to analog writing is: 2/3 size of the free memory space and the inactive memory space.
4. The method for cleaning up the memory of the mobile terminal according to claim 1 or 2, characterized in that the occupation situation of different types of memories of the current system is obtained based on the map table information of the system.
5. The method for cleaning up the memory of the mobile terminal according to claim 1 or 2, further comprising:
and informing the user of the size of the cleared memory while informing that the memory is cleared successfully.
6. A mobile terminal memory cleaning device comprises:
the memory acquisition unit is used for acquiring the occupation conditions of different types of memories of the current system;
the different types of the memory are as follows: the method comprises the following steps of occupying an active storage space, a storage space used by a system, an inactive storage space for storing background inactive process data and a current remaining available free storage space by a current program or application;
the simulation distribution unit is used for calculating the size of the memory data needing simulation writing according to the occupation conditions of the free storage space and the inactive storage active space;
the space cleaning unit is used for starting memory allocation in a memory pool based on the simulation memory data size simulation program, wherein when the memory allocation is successful, the memory is not written in, and the memory cleaning success is informed; and when the memory allocation fails, returning the information of the cleaning failure.
7. The apparatus according to claim 6, wherein the system of the mobile terminal is an IOS system.
8. The device for cleaning up the memory of the mobile terminal according to claim 6 or 7, wherein the size of the memory data to be simulated and written is: 2/3 size of the free memory space and the inactive memory space.
9. The device according to claim 6 or 7, wherein the memory obtaining unit is further configured to obtain occupation statuses of different types of memories of a current system based on map table information of the system.
10. The device according to claim 6 or 7, wherein the space cleaning unit is further configured to notify a user of the size of the cleaned memory while notifying that the memory is cleaned successfully.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410168542.XA CN104021085A (en) | 2014-04-24 | 2014-04-24 | Mobile terminal internal memory cleaning method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410168542.XA CN104021085A (en) | 2014-04-24 | 2014-04-24 | Mobile terminal internal memory cleaning method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104021085A true CN104021085A (en) | 2014-09-03 |
Family
ID=51437850
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410168542.XA Pending CN104021085A (en) | 2014-04-24 | 2014-04-24 | Mobile terminal internal memory cleaning method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104021085A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104268248A (en) * | 2014-09-30 | 2015-01-07 | 北京金山安全软件有限公司 | Recommendation method and device for application program and terminal |
CN104484282A (en) * | 2014-12-31 | 2015-04-01 | 广东欧珀移动通信有限公司 | Internal storage recovery method and device |
CN105808442A (en) * | 2014-12-27 | 2016-07-27 | 北京奇虎科技有限公司 | A mobile terminal memory clearing method and device |
WO2018228340A1 (en) * | 2017-06-16 | 2018-12-20 | 深圳市万普拉斯科技有限公司 | Memory block type processing method, device, electronic device, and readable storage medium |
CN109885260A (en) * | 2019-02-27 | 2019-06-14 | 广州三星通信技术研究有限公司 | Method and device for storing data in electronic terminal |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5996055A (en) * | 1997-11-26 | 1999-11-30 | Digital Equipment Corporation | Method for reclaiming physical pages of memory while maintaining an even distribution of cache page addresses within an address space |
US6173421B1 (en) * | 1997-04-18 | 2001-01-09 | Microsoft Corporation | Centrally handling runtime errors |
CN101382916A (en) * | 2007-09-06 | 2009-03-11 | 大唐移动通信设备有限公司 | Method for managing embedded system memory |
CN102831068A (en) * | 2011-06-13 | 2012-12-19 | 阿里巴巴集团控股有限公司 | Memory operating record processing method and device |
CN102984582A (en) * | 2012-11-12 | 2013-03-20 | 北京奇虎科技有限公司 | Intelligent television system management method and device carrying operating system |
CN103024539A (en) * | 2012-11-12 | 2013-04-03 | 北京奇虎科技有限公司 | Method and device for managing smart television system |
CN103092689A (en) * | 2013-01-10 | 2013-05-08 | 深圳市金立通信设备有限公司 | Method and terminal of process management |
CN103092769A (en) * | 2013-01-22 | 2013-05-08 | 北京奇虎科技有限公司 | Method and device of accelerating to mobile communication device |
CN103220427A (en) * | 2013-04-16 | 2013-07-24 | 广东欧珀移动通信有限公司 | Mobile phone background program cleaning method and mobile phone |
CN103514102A (en) * | 2013-10-25 | 2014-01-15 | 中国联合网络通信集团有限公司 | Memory garbage collecting method and device for Java virtual machine |
CN103544063A (en) * | 2013-09-30 | 2014-01-29 | 三星电子(中国)研发中心 | Process clearing method and device applied to Android platform |
-
2014
- 2014-04-24 CN CN201410168542.XA patent/CN104021085A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6173421B1 (en) * | 1997-04-18 | 2001-01-09 | Microsoft Corporation | Centrally handling runtime errors |
US5996055A (en) * | 1997-11-26 | 1999-11-30 | Digital Equipment Corporation | Method for reclaiming physical pages of memory while maintaining an even distribution of cache page addresses within an address space |
CN101382916A (en) * | 2007-09-06 | 2009-03-11 | 大唐移动通信设备有限公司 | Method for managing embedded system memory |
CN102831068A (en) * | 2011-06-13 | 2012-12-19 | 阿里巴巴集团控股有限公司 | Memory operating record processing method and device |
CN102984582A (en) * | 2012-11-12 | 2013-03-20 | 北京奇虎科技有限公司 | Intelligent television system management method and device carrying operating system |
CN103024539A (en) * | 2012-11-12 | 2013-04-03 | 北京奇虎科技有限公司 | Method and device for managing smart television system |
CN103092689A (en) * | 2013-01-10 | 2013-05-08 | 深圳市金立通信设备有限公司 | Method and terminal of process management |
CN103092769A (en) * | 2013-01-22 | 2013-05-08 | 北京奇虎科技有限公司 | Method and device of accelerating to mobile communication device |
CN103220427A (en) * | 2013-04-16 | 2013-07-24 | 广东欧珀移动通信有限公司 | Mobile phone background program cleaning method and mobile phone |
CN103544063A (en) * | 2013-09-30 | 2014-01-29 | 三星电子(中国)研发中心 | Process clearing method and device applied to Android platform |
CN103514102A (en) * | 2013-10-25 | 2014-01-15 | 中国联合网络通信集团有限公司 | Memory garbage collecting method and device for Java virtual machine |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104268248A (en) * | 2014-09-30 | 2015-01-07 | 北京金山安全软件有限公司 | Recommendation method and device for application program and terminal |
CN104268248B (en) * | 2014-09-30 | 2018-06-05 | 北京金山安全软件有限公司 | Recommendation method and device for application program and terminal |
CN105808442A (en) * | 2014-12-27 | 2016-07-27 | 北京奇虎科技有限公司 | A mobile terminal memory clearing method and device |
CN104484282A (en) * | 2014-12-31 | 2015-04-01 | 广东欧珀移动通信有限公司 | Internal storage recovery method and device |
CN104484282B (en) * | 2014-12-31 | 2017-07-07 | 广东欧珀移动通信有限公司 | A kind of method for recovering internal storage and device |
WO2018228340A1 (en) * | 2017-06-16 | 2018-12-20 | 深圳市万普拉斯科技有限公司 | Memory block type processing method, device, electronic device, and readable storage medium |
US11137934B2 (en) | 2017-06-16 | 2021-10-05 | Oneplus Technology (Shenzhen) Co., Ltd. | Memory block type processing method applicable to electronic device electronic device and non-transitory computer readable storage medium |
CN109885260A (en) * | 2019-02-27 | 2019-06-14 | 广州三星通信技术研究有限公司 | Method and device for storing data in electronic terminal |
CN109885260B (en) * | 2019-02-27 | 2023-02-24 | 广州三星通信技术研究有限公司 | Method and device for storing data for electronic terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104021085A (en) | Mobile terminal internal memory cleaning method and device | |
CN104008061B (en) | Method for recovering internal storage and device | |
US8423710B1 (en) | Sequential writes to flash memory | |
CN105159777A (en) | Process memory recovery method and device | |
CN103678536A (en) | Method and device for implementing page returning | |
CN103268201A (en) | Data storing method, storing device and reading method | |
CN104199784B (en) | A kind of data migration method and device based on classification storage | |
EP2919120A1 (en) | Memory monitoring method and related device | |
CN105094708A (en) | Method and apparatus for predicting disk capacity | |
CN112269665B (en) | Memory processing method and device, electronic equipment and storage medium | |
CN105700956A (en) | Distributed job processing method and system | |
CN102135943B (en) | Storing and accessing method of flash memory data and device thereof | |
CN104571956A (en) | Data writing method and splitting device | |
CN103077120A (en) | Address conversion method and device of application shared memory | |
CN103473343A (en) | File management method, device and terminal | |
CN110083379A (en) | A kind of server component upgrade method and relevant apparatus | |
CN106897022B (en) | A kind of method and device of management storage equipment | |
CN105389266A (en) | Data management method and apparatus | |
CN105183585A (en) | Data backup method and device | |
CN110990301A (en) | Sequential reading method of multi-plane storage medium and related device | |
CN111831691B (en) | Data reading and writing method and device, electronic equipment and storage medium | |
CN115237826A (en) | Automatic application cache cleaning method and related equipment | |
CN104199729A (en) | Resource management method and system | |
CN104793899A (en) | Method and device detecting whether Raid is pulled out or not on basis of virtual disk layer | |
US20170147247A1 (en) | Data Processing Method and Device for Storage Card |
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: 20140903 |