The system evaluates the importance of processes and presents the importance in the value "oom_adj" to each process. (The system determines which processes need to be terminated based on "oom_adj, in general, the larger the value of "oom_adj", the higher the process may be terminated by the system selected) (please send an email to the freeget.one@gmail.com to obtain the strong software .)
The "oom_adj" value of the foreground program is 0, which means that it will not be terminated by the system. Once it is inaccessible, it will get a higher "oom_adj ", the author assumes that the value of "oom_adj" is determined based on the position of the software in the LRU list;
Unlike Linux, Android has a unique set of process management modules. This module is more customizable and can be used to determine process management policies based on the range of "oom_adj" values, for example, you can set "when the memory is less than X, end the process with" oom_adj "greater than Y ". This gives you more options for writing process management scripts.
Android divides processes into six categories:
- Foreground process (foreground ):Processes and some system processes are currently displayed on the screen. For example, system processes such as dialer storage and Google search are front-end processes. For example, when you run a program such as a browser and the browser interface is displayed on the front-end, the browser is a foreground process (foreground), but once you press home to return to the main interface, the browser becomes a background program ). The process we do not want to terminate is the foreground process.
- Visible process (visible ):Visible processes are processes that are not on the frontend, but are still visible to users. For example, widgets, input methods, and so on are all visible. Although these processes are not on the frontend, they are closely related to our use and we do not want them to be terminated (you certainly do not want the clocks, weather, news, and other widgets to be terminated, they cannot be synchronized, and you do not want the input method to be terminated. Otherwise, you need to restart the input method every time you input the data)
- Secondary Service (secondary server ):Some services currently running (major services, such as dialing, cannot be terminated by process management, so here we only talk about secondary services). For example: Google Enterprise suite, gmail internal storage, internal contact storage, etc. Although this part of the service is a secondary service, it is closely related to some system functions. We often need them, so we do not want them to be terminated.
- Background process (hidden ):Although the author uses the word "hidden", it is actually the background process, which is a process that is usually understood to be switched to the background after startup, such as a browser or a reader. When a program is displayed on the screen, it runs a foreground process. Once we press home to return to the main interface (note that we press home instead of back ), the program resides in the background and becomes the background process ). There are multiple management policies for background processes: There are more active methods. Once the program is terminated immediately after it reaches the background, this method will increase the program running speed, but it cannot be restarted; there are also relatively negative ways to retain as many background programs as possible. Although it may affect the running speed of a single program, the speed will be improved when the started program is started again. Here, you need to find a balance point based on your usage habits.
- Content Provider ):There is no program entity, and only content is provided to other programs for use, such as calendar supply nodes and mail supply nodes. When terminating a process, such programs should have a higher priority.
- Empty Process (empty ):There are no processes running in the process. Some programs, such as BTE, will still reside in an empty process after the program exits, and no data is running in the process, the function is to increase the next Startup speed of the program or record some historical information of the program. This part of the process should undoubtedly be terminated first.
For Android users who use Windows habits and ideas, they always habitually install taskkiller or advanced task manager. From time to time, they can see how much RAM is left. The following describes the android process operating mechanism and why the process manager is not required. In Android, the process and the program are two different things. The program can be kept in the system, but no process is "running" in the background, and no system resources are consumed. All programs are stored in the memory, and all programs can be started back to their previous State faster. When your memory is used up, the system will automatically kill the tasks you don't need.
Android adopts a process management policy different from Linux, which ends the process after the process activity of Linux stops. Android keeps these processes in the memory, until the system requires more memory. The processes stored in the memory usually do not affect the overall system running speed, and the process startup speed is improved when the user activates these processes again.
After you exit a program in the Android system, the system will mark the program and place it in Ram. It only occupies the ram space and does not consume CPU operations. For example, you use UC, it will take more than 6 seconds to start and consume more power next time. However, if you use a small house to build the background, you can start it instantly, which means you can quickly open the software you opened, return to the previous position. Therefore, Android uses Ram effectively. Many users think that their calls are slowed down when their Ram is full. In fact, it is your CPU. What you use when your software is actually running is the bottleneck of mobile phone dragging. If you are familiar with windows, you always need to use the process manager to kill the program. This will only consume more power when you open the program next time, because you can re-open the program, you are actually using CPU resources to do this.