android进程死了(adj *),什么是adj?
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了android进程死了(adj *),什么是adj?,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2322字,纯文字阅读大概需要4分钟。
内容图文
![android进程死了(adj *),什么是adj?](/upload/InfoBanner/zyjiaocheng/967/bd49d2d8692e49fcbe1ff330cfb5d119.jpg)
在我的Galaxy S III上,使用logcat,我可以非常频繁地看到该过程已经死亡.
(adj 5),(adj 8),(adj 9)和(adj 10)是什么意思?
以下是设备logcat: –
I/ActivityManager( 2258): Process com.google.android.partnersetup (pid 32242) (adj 10) has died.
I/ActivityManager( 2258): Process com.metago.astro (pid 32446) (adj 10) has died.
D/dalvikvm(32602): WAIT_FOR_CONCURRENT_GC blocked 0ms
I/ActivityManager( 2258): Process com.google.android.gms (pid 32272) (adj 10) has died.
I/ActivityManager( 2258): Process com.whatsapp (pid 12041) (adj 8) has died.
D/KeyguardViewMediator( 2258): setHidden false
D/WindowManager( 2258): mInputFocus is not null.
I/ActivityManager( 2258): Process com.sec.spp.push (pid 19839) (adj 8) has died.
I/ActivityManager( 2258): Process com.test.happ.jiffy (pid 556) (adj 5) has died.
解决方法:
当内存不足时,android系统会杀死一些后台进程,每个进程都有一个表示其重要性的adj值.低优先级进程将首先被杀死.
ProcessList.java中定义的值
class ProcessList {
// The minimum time we allow between crashes, for us to consider this
// application to be bad and stop and its services and reject broadcasts.
static final int MIN_CRASH_INTERVAL = 60*1000;
// OOM adjustments for processes in various states:
// This is a process only hosting activities that are not visible,
// so it can be killed without any disruption.
static final int HIDDEN_APP_MAX_ADJ = 15;
static int HIDDEN_APP_MIN_ADJ = 9;
// The B list of SERVICE_ADJ -- these are the old and decrepit
// services that aren't as shiny and interesting as the ones in the A list.
static final int SERVICE_B_ADJ = 8;
// This is the process of the previous application that the user was in.
// This process is kept above other things, because it is very common to
// switch back to the previous app. This is important both for recent
// task switch (toggling between the two top recent apps) as well as normal
// UI flow such as clicking on a URI in the e-mail app to view in the browser,
// and then pressing back to return to e-mail.
static final int PREVIOUS_APP_ADJ = 7;
// This is a process holding the home application -- we want to try
// avoiding killing it, even if it would normally be in the background,
// because the user interacts with it so much.
static final int HOME_APP_ADJ = 6;
有关android内存管理的更多信息可以参考http://developer.android.com/guide/components/processes-and-threads.html
内容总结
以上是互联网集市为您收集整理的android进程死了(adj *),什么是adj?全部内容,希望文章能够帮你解决android进程死了(adj *),什么是adj?所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。