Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Low Memory Killer – Android のプロセス優先順位

昨日の Android Bazaar and Conference 2011 Summer の出村さんのセッション「Linuxカーネルから紐解くAndroid」で、Android の Low Memory Killer の話を聴きました。Androidでは裏に回ったアプリはそのままスリープした状態で残っておりメモリが足りなくなるとOSが自動的にKillする、というくらいの知識はあったのですが、具体的な優先順位などの話があり興味深いものでした。

優先順位は init.rc の中で定義されているとのことで、Galaxy S2でも確認してみました。以下のように書かれていました。

init.rc の中の Low Memory Killerに関する定義

講演のスライドとだいたい同じですが、CONTENT_PROVIDER が無いようです。あとプロセスをKILLする閾値は多少大きいようです。

読み方は、メモリが 4K * 6144ページ = 24576K 以下になったら (裏に回っている)ホームアプリを KILLする、ということでいいのかな?

FOREGROUND_APPは前面で動作中のアプリ、VISIBLE_APPはユーザから見えているアプリ、PERCEPTIBLE_APPはユーザから認識可能なアプリだそうです。例えば、バックグラウンドで音楽を再生するアプリがそうです。HEAVY_WEIGHT_APPはウェイトが高いということでしょうけどよくわかりません。SECONDARY_SERVERは何だろう。BACKUP_APP は何かデータをバックアップするアプリ? HOME_APPはホームアプリ。HIDDEN_APPはいわゆる裏に回った普通のアプリですね。EMPTY_APPは何?からっぽのアプリ?

Androidで裏に回ったアプリ(というかプロセス)を殺すにあたっては、結構、細かい種類に分けて管理しているということがわかりました。

あと、サービスはこれとは別扱いになっていて、OSからは殺されないはずです。

PAGE TOP