Skip to content

Instantly share code, notes, and snippets.

@iflove
Last active May 9, 2021 13:56
Show Gist options
  • Save iflove/87114fc7ef4ba3b7a20819b960b4eaee to your computer and use it in GitHub Desktop.
Save iflove/87114fc7ef4ba3b7a20819b960b4eaee to your computer and use it in GitHub Desktop.
Android应用与系统稳定性
@iflove
Copy link
Author

iflove commented Jan 8, 2021

Android应用与系统稳定性——FD泄露
内核进程结构体task_struct中为每个进程维护了一个数组,数组下标就是fd,里面存储的是对这个文件的描述了。

  1. FD泄露问题会导致文件、线程、socket等资源无法使用,app闪退
  2. 排查方式:ls -l /proc/进程PID/fd/进程线程信息:ps -t <pid> ; lsof -p <pid>; Tombstone文件中有open files ; /proc/pid/status中threads项(当前线程数目), /proc/pid/task来监控线程使用情况
  3. hprof-conv.exe

@iflove
Copy link
Author

iflove commented May 9, 2021

System_Server与Zygote共存亡

System_Server 进程意外崩溃或者被退出,Zygote也终结重新开始

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment