Skip to content

Commit 89fce9b

Browse files
committed
add
1 parent af0e977 commit 89fce9b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Android/_总结.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,15 @@ public static void main(String[] args) {
307307

308308
指程序在申请内存时,没有足够的内存空间供其使用,**内存泄漏**是导致其出现的主要原因
309309

310+
#### 内存抖动
311+
312+
内存抖动是由于短时间内有大量对象进出新生区导致的,它伴随着频繁的GC,gc会大量占用ui线程和cpu资源,会导致app整体卡顿。
313+
314+
- 避免在循环体内创建对象,应该把对象创建移到循环体外。
315+
- 自定义View的`onDraw`会被频繁调用,不应该在里面频繁创建对象
316+
- Bitmap的复用
317+
- 能够复用的对象,可以用池来做缓存
318+
310319
#### 布局优化
311320

312321
- **include**:避免布局重用,更加利于维护

0 commit comments

Comments
 (0)