We have different opinions on the background process of Android.

Source: Internet
Author: User

Address: http://www.eoeandroid.com/thread-156394-1-1.html

In the afternoon, I saw two posts on the Internet:
Article 1: Miscellaneous: Impact of background processes on Android Performance
Android is so popular now that a variety of devices are everywhere, such as high school and low-grade, large and small screens, but it has never achieved the amazing experience and performance of IOS, its operation smoothness, performance and security are always slightly inferior to IOS. It is said that iPhone 4 is a single-core M memory, but it is smoother than the android dual-core 1g memory operation, although ipad2 is also only M memory, but the operation is smoother than the android quad-core 1g memory. In addition, it is not as secure as IOS.

The reason for poor android performance, standby time, smooth operation, and security is the management of background processes.

The Process Management of Android is poor, which is also the cause of poor performance. The smoothness of operations, the standby time, and the performance are closely related to process management, especially the management of background processes. When you open your mobile phone, several decades of processes are running, such as text messages, emails, and input methods. Many other applications are also running in the background, whether or not they are started by users, many applications are running in the backend, which has become the most difficult issue for Android users. What's more, many processes cannot be killed by tools such as task manager and process killer.

The main reason is that the key components in Android have a long life cycle, such as broadcastreceiver and service, and the improper application of threads. A service is a component used for long-term operation in the background to complete long-term tasks in the background, such as playing songs in the background, receiving emails and text messages in the background. Broadcastreceiver is a long-term component that is normally inactive. It is activated only when intent broadcast appears, although it is inactive, but it is still alive and its process is still running. In addition, the activity can be run for a long time. By using movetasktoback (), the activity can be stored in the background without destruction, or the thread can be run in the activity. If the thread is not stopped when the activity is destroyed, then the thread will still run and the process will still run.

This is determined by the Android system architecture. For processes with components running, that is, killing them using the task manager, activitymanager will restart the process. Therefore, for Android programs, developers need to work hard to correctly apply these components so that the applications can run when they are used by users and exit completely when they are not needed.

However, the reason why most applications are secretly running in the background is mainly caused by Android Developers.

As we all know, Android Developers are not very profitable, so developers are reluctant to invest too much energy in optimizing performance because they cannot get a return.

In addition, the program runs in the background to collect user usage habits and data so as to serve as a reference data for subsequent development.

The iOS device does not have such a situation. It has strict background process control, and the program exits, that is, it exits. In addition, in its recent application bar (double-click the Home key, or four fingers pull up). After you press the application long, click the number one in the upper left corner to close the application. If the application is disabled, it will not start again unless the user starts it. Whether or not the application is actually exited, at least from the user's perspective.

Article 2: do Android background programs need to be manually disabled?
In view of the fact that there are many TX that are used to automatically kill processes in order to leave a larger memory space, there are also many TX that say too many background programs will consume too much power. Here are two articles to share with you.

Article 1: [knowledge] rational use of memory, correct understanding of the principle of the task manager Android memory, do not care about the remaining memory size. in fact, many people bring the habit of using other systems. most Android applications do not exit the design, which is related to the process scheduling mechanism of the system. if you know Java, you can better understand this mechanism. in fact, similar to Java's garbage collection mechanism, the system has a rule to recycle memory. there is a threshold value for memory scheduling. Only systems lower than this threshold will close things that are not needed by a single list. of course, this value is set very small by default, so you will see that the memory is always at a very small number. but in fact, it does not affect the speed. on the contrary, it accelerates the next application startup. this is one of the advantages advertised by Android. It is not necessary to manually close the process. in particular, software that automatically disables processes. some may say here, why is it slow to run large programs when there is little memory? In fact, it is very simple to open a large program when there is not much memory left, it will trigger the system's own process scheduling policy, which is a very expensive operation of system resources, especially when a program frequently requests memory from the system. in this case, the system does not shut down all open processes, but closes them selectively. frequent scheduling will naturally slow down the system. therefore, there is a program on the forum that can change the memory threshold value to some extent.
However, changes may also cause some problems, depending on the Value Setting. Is there any need for the Process Management Software? Yes. before running a large program, you can manually close some processes to release the memory, which can significantly improve the running speed. however, some small programs can be managed by the system. when talking about this, some may ask if the program will consume more power. I will talk about the principles of the android background, and you will understand it. when an Android app is switched to the background, it is actually suspended and does not consume CPU resources, but only keeps running. so why does some programs switch out and re-enter the main interface. however, if a program wants to process something in the background, such as playing music, it will enable a service. services can continue to run in the background, so only applications with services consume power in the background. this can be seen in the process management software. The label is service. I will not talk about broadcast or anything. therefore, applications without services do not consume any power in the background, and there is no need to disable them. this design is a very good design. It will be faster when you start the program next time. Because you do not need to read interface resources, why should you disable them to erase the advantages of Android? There is another one. why does an Android app seem to consume so much memory. as you know, Android applications use Java and virtual machines, while Android applications use independent virtual machines, that is, each application opens an independent virtual machine. the reason for this design is to avoid the crash of the entire system caused by Virtual Machine crash, but the cost is more memory. the above design ensures the stability of Android. Under normal circumstances, a single program may crash at most, but the entire system will not crash and there will never be any prompts of insufficient memory. you may be poisoned too deeply by windows and always want to keep more memory, but in fact this does not necessarily increase the speed. On the contrary, it has lost the system feature of fast program startup, not necessary. you may wish to use this system as I said. finally, we recommend a process management software, which can be found on systempanel and market. The interface is easy to start and has good functions. It is used to manually close the process.
I wish you a good time playing with the computer. This system has been running for ten days and a half months. It's not windows. as to why switching slows down after opening a large program or several programs, I understand the following: 1. large program a has been enabled and occupies 70% of the memory. If you want to run another program B and need 50% of the memory, you need to release or compress a from the memory, so it is shown to be slow for a while. 2. ABCDE occupies a total of 80% of the memory and requires 20% of the memory to run the new program Z. Because the system memory has never seen the remaining 0, that is, there should be a portion of the idle memory, you need ~ E. Select one or more of these programs to close the service. This process also consumes system resources, so it will take a while. that is to say, when you manually kill the program, the system is releasing the memory for the system. Even if you do not kill the program, the system will automatically release it when the memory is needed. 4. programs that are not running in the background (No Service) will not consume power even if they are not killed. programs running in the background (with services), such as playing songs in the background, will certainly consume power. 5. it doesn't mean that killing processes is useless, or the author won't recommend process management software. which of the following services consumes power? the backend is always running. You can see the services. This should be done. 6. Take QQ as an example. If you exit normally, the QQ running status will be left in process management, but it does not consume electricity.
CPU, if you just switch out (by small house instead of exiting), it will naturally consume power, because the program is still running. (the same as the QQ background, the background is that when QQ Exits normally, it will be kept in the memory but will not occupy the CPU, and it will be very fast to start up again. This is why android can reasons Beyond wm6)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.