当前位置: 首页 > news >正文

好用的h5网站模板优化排名 生客seo

好用的h5网站模板,优化排名 生客seo,长安网站建设多少钱,肥城网站网站建设Android Car WatchDog I/O监控服务 背景: 某基于Android 13的车载系统。 某天长时间测试一款3方(非SystemApp)时,该款应用偶发闪退现象。 通过日志分析,发现应用被系统的 Car WatchDog(喂狗服务&#xff…

Android Car WatchDog I/O监控服务

  • 背景:
    某基于Android 13的车载系统。

某天长时间测试一款3方(非SystemApp)时,该款应用偶发闪退现象。
通过日志分析,发现应用被系统的 Car WatchDog(喂狗服务)Disable掉了。
日志如下

Disabled package *** on user*** until used due to resource overuse

对应的代码部分。
/packages/services/Car/service/src/com/android/car/watchdog/WatchdogPerfHandler.java

/** Disables a package for specific user until used. */
public boolean disablePackageForUser(String packageName, @UserIdInt int userId) {try {int currentEnabledState =PackageManagerHelper.getApplicationEnabledSettingForUser(packageName, userId);switch (currentEnabledState) {case COMPONENT_ENABLED_STATE_DISABLED:case COMPONENT_ENABLED_STATE_DISABLED_USER:case COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED:Slogf.w(TAG, "Unable to disable application for user %d, package '%s' as the "+ "current enabled state is %s", userId, packageName,toEnabledStateString(currentEnabledState));return false;}PackageManagerHelper.setApplicationEnabledSettingForUser(packageName,COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED, /* flags= */ 0, userId,mContext.getPackageName());appendToDisabledPackagesSettingsString(packageName, userId);Slogf.i(TAG, "Disabled package '%s' on user %d until used due to resource overuse",packageName, userId);} catch (Exception e) {Slogf.e(TAG, e, "Failed to disable application for user %d, package '%s'", userId,packageName);return false;}return true;
}

问题分析

Car WatchDog中的IO Monitor,会监监控所有应用或服务的磁盘I/O用量。以保证系统的稳定。主要包括:

  • 应用的磁盘I/O写入量。
  • 应用的System-wide I/O写入量(宽带)

当应用或服务超过预定义的阈值时,Car WatchDog会对相应的应用或者服务执行相应操作(比如 kill掉):

  • 系统服务或应用,不受限制(可以通过配置文件指定,哪些系统服务或应用受到监控)
  • 三方应用,监控被进行限制。

设定的阈值统计范围时,一天内。
Car WatchDog中的IO Monitor,会统计一天内的I/O使用情况。

上述问题分析

回到上面说的问题。某一款三方应用,偶尔退出,并且系统中存在下述日志。

Disabled package *** on user*** until used due to resource overuse

该日志说明,这款应用因为I/O使用超过阈值,被系统Kill。
后续通过复现,抓取IO相应日志,发现出现问题时该应用,在一天内的写入量超过3GB,这个值已经超过系统的阈值配置。

阈值配置文件:
/packages/services/Car/cpp/watchdog/server/data/third_party_resource_overuse_configuration.xml

<?xml version='1.0' encoding='utf-8'?>
<!-- Copyright (C) 2021 The Android Open Source ProjectLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
--><resourceOveruseConfiguration version="1.0"><componentType> THIRD_PARTY </componentType><ioOveruseConfiguration><!-- Default thresholds in MiB for all third-party packages that don't have app categoryspecific thresholds. --><componentLevelThresholds><state id="foreground_mode"> 3072 </state><state id="background_mode"> 2048 </state><state id="garage_mode"> 4096 </state></componentLevelThresholds></ioOveruseConfiguration>
</resourceOveruseConfiguration>

修改: 去掉该三方引用的无用I/O操作。后续测试,无偶先问题。

关于Android源码部分的实现,可以感兴趣的可以阅读如下源文件。
packages/services/Car/cpp/watchdog/server/src/IoOveruseMonitor.cpp

http://www.hengruixuexiao.com/news/47772.html

相关文章:

  • 如何做网站的cdn免费网站alexa排名查询
  • 用 htmi5做网站如何搭建企业网站
  • 系统开发的需求分析阶段的重要工作之一是山东seo多少钱
  • 网建服务苏州关键词优化搜索排名
  • 用ps切片做网站seo与sem的区别和联系
  • dreamweaver网页制作软件成都搜狗seo
  • 辽宁建设工程信息网注册流程江西网络推广seo
  • 做五金外贸哪个网站比较好媒体网站
  • 上海城市建设大学网站陕西网站建设网络公司
  • 生产企业做网站的费用怎么做账百度推广竞价是什么意思
  • 怎么建设一个网站赚钱营销策划公司靠谱吗
  • 营口网站建设seo线下培训班
  • 郑州电商网站开发关键少数
  • 艾瑞网的网站架构软文代写自助发稿平台
  • php手机网站制作福建seo网站
  • 怎么去找做网站的seo搜索引擎优化求职简历
  • 网站做推广要备案吗百度实名认证
  • 网上商城网站开发百度百度网址大全
  • 公司让做网站违法好消息tvapp电视版
  • 网络营销中关于网站设计7cs2023年适合小学生的新闻有哪些
  • wordpress连不上数据库西安专业seo
  • 做网站采集内容百度seo一本通
  • 定制网站建设公司推荐苏州网站优化排名推广
  • 上海做网站设计的公司廊坊优化技巧
  • 怎么做自己的网购网站朋友圈软文
  • 我自己做的网站打开很慢最近的国际新闻大事10条
  • 建设项目验收 网站百度sem
  • 哪个网站有免费游戏推广
  • 怎么知道公司网站是哪家做的淘宝优秀软文范例100字
  • 宁志网站两学一做昆明百度推广开户