Android performance optimization

When the CPU and memory are used unreasonably or consume a lot of resources, you will encounter stability problems caused by insufficient memory, and stall problems caused by too much CPU consumption.

1. Caton optimization

Android applications start slowly and often freeze during use, which greatly affects the user experience and should be avoided as much as possible. There are many stagnant scenes, which can be divided into 4 categories according to scenes: UI drawing, application startup, page jump, and event response, as shown in the figure:



The root causes of these 4 kinds of stuck scenes can be divided into two categories:

* Interface drawing. The main reasons are the deep level of drawing, the complexity of the page, and the unreasonable refresh. Due to these reasons, the scenes of stuttering appear more in the UI, the initial interface after startup, and the drawing that jumps to the page.

* data processing. The reason for this kind of stuck scene is that the amount of data processing is too large, generally divided into three situations, one is that the data is processing the UI thread, the other is that the data processing takes up high CPU, causing the main thread to not get the time slice, and the third is memory The increase leads to frequent GC, which causes lag.

Guess you like

Origin blog.csdn.net/sinat_33250050/article/details/114258914