1. Android Studio-Memory Monitor How to use Run your project, find the Memory Monitor window, select Memory [Transfer] Memory change waveform In addition, you can also choose to view the usage of CPU, GPU and NetWork. Network usage waveform.png Frequent use of Network is the key factor causing power consumption of applications. About 70% of the power is used for reporting data, checking location information, and regularly retrieving background advertising information. How to balance the power consumption of these two is very important. 2. Android Studio 1.5 Preview New Toy - Heap Snapshot How to use Run the project again, perform some operations and click the 'Dump Java Heap' button in the lower left corner A .hprof file will be generated after each click Click on a .hprof file and look at the analyzer test on the right. You can see two options One is 'Detect Leaeked Activites' and the other is 'Find Duplicate Strings'. Click the green play button in the upper right corner to automatically analyze the heap dump to locate the leaked activity and duplicate strings. The following Analysis Results will appear. There are three types of information in this panel: app heap/image heap/zygote heap. They represent the app heap memory information, image heap memory information, and zygote process heap memory information respectively. Chinese and English comparison table of each attribute
Eclipse-Allocation Tracker How to use Click Start Tracking, perform an action in your app, and then click Get Allocations. Allocation Tracker Features a. Intermittent operation is required b. Can locate a specific line of code 4. HierarchyViewer Use hierarchyviewer to view the hierarchy of the page you need to check, and check the deepest number of pages. The official recommendation is to keep it within 10 layers. hierarchyviewer Layout level optimization solution: 1). Custom controls use the merge tag to reduce unnecessary root nodes; 2). Use drawableleft instead of adding an extra imageview; 3). Sometimes using relativelayout requires fewer layers than linearlayout to achieve the desired effect; 4). Use viewstub to hide controls. The layout in ViewStub will be rendered to the main interface only when you need it; ... 5. Leakcanary (Android and Java memory leak detection framework) Android Studio https://github.com/square/leakcanary Eclipse https://github.com/SOFTPOWER1991/LeakcanarySample-Eclipse 6. Phone Settings->Developer Options 1. Show GPU Overdraw Show GPU Overdraw Blue, light green, light red, and dark red represent four different degrees of overdraw. Our goal is to minimize red overdraw and see more blue areas. Optimization plan: Overdraw sometimes occurs because your UI layout has a lot of overlapping parts, and sometimes it is caused by unnecessary overlapping backgrounds. For example, an Activity has a background, and the Layout inside it has its own background, and the sub-Views also have their own backgrounds. Simply by removing unnecessary background images, you can reduce a lot of red Overdraw areas and increase the proportion of blue areas. This measure can significantly improve program performance. Profile GPU Rendering - Check the option On screen as bars Each bar line consists of three parts. The blue part represents the time to measure the drawing of the Display List, the red part represents the time required for OpenGL to render the Display List, and the yellow part represents the time the CPU waits for GPU processing. There is a green horizontal line in the middle, representing 16ms. We need to ensure that the total time spent on each frame is lower than this horizontal line to avoid lag problems. |
>>: 【Practical】Mobile QQ and Qzone Speed Optimization Practice
Although there has been a saying since ancient ti...
As we all know, information flow advertising is t...
In 2013, the scale of China's chip imports rea...
[[158074]] I have thought about starting a busine...
The peaceful television industry was disrupted by...
: : : : : : : : : : : : : : :...
When buying a car, modern people not only have mo...
How to maintain and increase activity and improve...
The course is produced by Yecao and Qianlima and ...
As a veteran who has been in the APP promotion in...
The war between Xiaomi and LeTV has been going on...
The way for free tools to acquire users must be a ...
WeChat Mini Program is an application that users ...
A few days ago, we conducted a small survey in th...
As a female young scientist born in the 1980s who...