Skip to content

Instantly share code, notes, and snippets.

@Hasiy
Created November 7, 2019 05:32
Show Gist options
  • Save Hasiy/357835a8436a2221aa422078e804a030 to your computer and use it in GitHub Desktop.
Save Hasiy/357835a8436a2221aa422078e804a030 to your computer and use it in GitHub Desktop.
SoftReference<Bitmap> 软引用对象
WeakReference<ImageView> 弱引用对象
强引用: 普通变量都属于强引用,比如 private Context context;
软引用: SoftReference,在发生OOM之前,垃圾回收器会回收SoftReference引用的对象。
弱引用: WeakReference,发生GC的时候,垃圾回收器会回收WeakReference中的对象。
虚引用: 随时会被回收,没有使用场景。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment