当前位置:网站首页>3、 Zygote start process
3、 Zygote start process
2022-04-23 22:04:00 【Laugh three little_ Creat】
zygote By app_main.cpp Inside AppRuntime Object's start() After the method is started, the following things are done
find \frameworks\base\core\java\com\android\internal\os\ZygoteInit.java open main() The following code can be seen in the function
1、 establish ZygoteServer
ZygoteServer zygoteServer = new ZygoteServer();
2、 Load classes ahead of time , Load system resources , Load other
// In some configurations, we avoid preloading resources and classes eagerly.
// In such cases, we will preload things prior to our first fork.
if (!enableLazyPreload) {
bootTimingsTraceLog.traceBegin("ZygotePreload");
EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START,
SystemClock.uptimeMillis());
preload(bootTimingsTraceLog);// Preload core method
EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END,
SystemClock.uptimeMillis());
bootTimingsTraceLog.traceEnd(); // ZygotePreload
}
preload() method code :
static void preload(TimingsTraceLog bootTimingsTraceLog) {
preloadClasses();
preloadResources();
nativePreloadAppProcessHALs();
preloadOpenGL();
preloadSharedLibraries();
preloadTextResources();
}
3、 start-up SystemServer
if (startSystemServer) {
Runnable r = forkSystemServer(abiList, socketName, zygoteServer);
if (r != null) {
r.run();// Execute through reflection mechanism SystemServer.java Of main() function
return;
}
}
4、 Loop to receive subprocess messages
// The select loop returns early in the child process after a fork and
// loops forever in the zygote.
caller = zygoteServer.runSelectLoop(abiList);
Uncle , Give me a coin
版权声明
本文为[Laugh three little_ Creat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/113/202204232202429762.html
边栏推荐
- Oracle intercepts special characters
- 分布式系统服务熔断
- When pycharm debugs, view the tensor image of pytorch in the console
- OpenFeign之响应处理
- IIS cannot load * woff,*. woff2,*. Solution of SVG file
- [leetcode refers to the substructure of offer 26. Tree (medium)]
- [※ leetcode refers to offer 46. Translate numbers into strings (medium)]
- 21. Basic usage of MariaDB
- POI和EasyExcel讲解
- JS to get the browser and screen height
猜你喜欢
随机推荐
在线Excel转CSV工具
Detectron2 using custom datasets
服务间通信方式
轻量化项目管理思路
ERP function_ Financial management_ Basic concepts of Finance
Ribbon组件负载均衡调用和使用
C list data paging
How Axure installs a catalog
在线时序流程图制作工具
Strictly, severely and quickly strengthen food safety supervision during the epidemic in Shanghai
Pycharm Chinese plug-in
Subcontracting of wechat applet based on uni app
Display, move, rotate
[leetcode sword finger offer 10 - II. Frog jumping steps (simple)]
LabVIEW显示控件中内容过长设置自动滚动条
Resolve the "chromedriver executable needs to be in path" error
VMware download and installation links are very easy to use
延时消息常见实现方案
[leetcode sword finger offer 58 - I. flip word order (simple)]
Oracle ora-01033: Oracle initialization or shutdown in progressprocess solution