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

广告网站设计html菜鸟初学

广告网站设计,html菜鸟初学,大的网站建设公司好,网络规划设计师2022论文5月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.yayakq.cn/news/814677/

相关文章:

  • 网站备案要多少天中山做网站建设联系电话
  • 企业网站html模板wordpress文章列分页
  • 网站百度收录公司网站模板制作
  • 大连网站制作431手机怎么做三个视频网站
  • 做游戏视频网站word超链接网站怎样做
  • 学校网站英文甘孜建设机械网站
  • php 网站 手机版wordpress的站点是什么
  • 台州学校网站建设成都娱乐场所关闭最新消息
  • 淮南商城网站建设地址如何建微网站
  • 5台电脑做视频网站服务器网站建设有什么费用
  • html5国内网站建设浙江网站建设正规公司
  • 怎样免费建立个人网站网站底部空白
  • 长宁广州网站建设文件目录模板wordpress
  • 外贸网站虚拟主机网络营销与策划
  • 135网站模板北京手机网站建设公司排名
  • 网站网站集约化建设大冶seo网站优化排名推荐
  • 专门做汽车gps贷款网站手机网站建站用哪个软件好
  • 景泰县做网站wordpress首页不更新
  • 网站推广策划方案模板口碑营销方案
  • 网站服务器开发长春网站建设方案优化
  • 青岛做网站皆赴青岛博采网络山东浩景建设有限公司网站
  • 淘宝入驻网站建设wordpress链接亚马逊
  • 微信怎么做网站的动图织梦网站管理系统
  • 做游戏网站在哪里找常德做网站多少钱
  • 智慧城市建设评价网站怎样做京东网站
  • 南通网站定制vi视觉设计报价
  • 庆阳市建设局网站专业瓷砖美缝网站怎么做
  • 仪征做网站公司wordpress 文章加密
  • 网站优化排名推荐企业网站建设公司那家好
  • 深圳南山 网站建设网页设计与网站建设考试