ART と Dalvik は DEX バイトコードを実行する相互に互換性のあるランタイムであり、Dalvik 用に開発されたアプリは ART で実行しても動作します。ただし、Dalvik で機能する一部の手法は ART では機能しません。最も重要な問題については、Android ランタイム(ART)でのアプリの動作確認をご覧ください。
ART の機能
以下では、ART で実装される主な機能をいくつか紹介します。
事前(AOT)コンパイル
ART は、事前(AOT)コンパイルの導入によりアプリのパフォーマンスを改善します。また、ART では Dalvik よりインストール時の検証が厳格になっています。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 UTC。"],[],[],null,["# Android runtime and Dalvik\n\nAndroid runtime (ART) is the managed runtime used by apps and some system\nservices on Android. ART and its predecessor Dalvik were originally created\nspecifically for the Android project. ART as the runtime executes the Dalvik\nexecutable (DEX) format and DEX bytecode specification.\n\nART and Dalvik are compatible runtimes running DEX bytecode, so apps\ndeveloped for Dalvik should work when running with ART. However, some\ntechniques that work on Dalvik do not work on ART. For information about the\nmost important issues, see [Verifying\napp behavior on the Android runtime (ART)](http://developer.android.com/guide/practices/verifying-apps-art.html).\n\nART features\n------------\n\nHere are some of the major features implemented by ART.\n\n### Ahead-of-time (AOT) compilation\n\nART introduces ahead-of-time (AOT) compilation, which can improve app\nperformance. ART also has tighter install-time verification than Dalvik.\n\nAt install time, ART compiles apps using the on-device\n**dex2oat** tool. This utility accepts [DEX](/docs/core/runtime/dex-format) files as input and generates\na compiled app executable for the target device. The utility should be able to\ncompile all valid DEX files without difficulty. However, some post-processing\ntools produce invalid files that may be tolerated by Dalvik but cannot be\ncompiled by ART. For more information, see [Addressing\nGarbage Collection Issues](http://developer.android.com/guide/practices/verifying-apps-art.html#GC_Migration).\n\n### Improved garbage collection\n\nGarbage collection (GC) is very resource intensive, which can impair an app's performance,\nresulting in choppy display, poor UI responsiveness, and other problems. ART improves garbage\ncollection in several ways:\n\n- Mostly concurrent design with a single GC pause\n- Concurrent copying to reduce background memory usage and fragmentation\n- The length of the GC pause is independent of the heap size\n- Collector with lower total GC time for the special case of cleaning up recently-allocated, short-lived objects\n- Improved garbage collection ergonomics, making concurrent garbage collections more timely, which makes [`GC_FOR_ALLOC`](http://developer.android.com/tools/debugging/debugging-memory.html#LogMessages) events extremely rare in typical use cases\n\n### Development and debugging improvements\n\nART offers a number of features to improve app development and debugging.\n\n#### Support for sampling profiler\n\nHistorically, developers have used the [Traceview](http://developer.android.com/tools/help/traceview.html)\ntool (designed for tracing\napp execution) as a profiler. While Traceview gives useful information,\nits results on Dalvik have been skewed by the per-method-call overhead, and use\nof the tool noticeably affects run time performance.\n\nART adds support for a dedicated sampling profiler that does not have these\nlimitations. This gives a more accurate view of app execution without\nsignificant slowdown. Sampling support was added to Traceview for\nDalvik in the KitKat release.\n\n#### Support for more debugging features\n\nART supports a number of new debugging options, particularly in monitor- and\ngarbage collection-related functionality. For example, you can:\n\n- See what locks are held in stack traces, then jump to the thread that holds a lock.\n- Ask how many live instances there are of a given class, ask to see the instances, and see what references are keeping an object live.\n- Filter events (like breakpoint) for a specific instance.\n- See the value returned by a method when it exits (using \"method-exit\" events).\n- Set field watchpoint to suspend the execution of a program when a specific field is accessed and/or modified.\n\n#### Improved diagnostic detail in exceptions and crash reports\n\nART gives you as much context and detail as possible when runtime exceptions\noccur. ART provides expanded exception detail for [java.lang.ClassCastException](http://developer.android.com/reference/java/lang/ClassCastException.html),\n[java.lang.ClassNotFoundException](http://developer.android.com/reference/java/lang/ClassNotFoundException.html),\nand [java.lang.NullPointerException](http://developer.android.com/reference/java/lang/NullPointerException.html).\n(Later versions of Dalvik provided expanded exception detail for [java.lang.ArrayIndexOutOfBoundsException](http://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException.html)\nand [java.lang.ArrayStoreException](http://developer.android.com/reference/java/lang/ArrayStoreException.html),\nwhich now include the size of the array and the out-of-bounds offset, and ART\ndoes this as well.)\n\nFor example, [java.lang.NullPointerException](http://developer.android.com/reference/java/lang/NullPointerException.html)\nnow shows information about what the app was trying to do with the null pointer,\nsuch as the field the app was trying to write to, or the method it was trying to\ncall. Here are some typical examples: \n\n```\njava.lang.NullPointerException: Attempt to write to field 'int\nandroid.accessibilityservice.AccessibilityServiceInfo.flags' on a null object\nreference\n``` \n\n```\njava.lang.NullPointerException: Attempt to invoke virtual method\n'java.lang.String java.lang.Object.toString()' on a null object reference\n```\n\nART also provides improved context information in app native crash reports,\nby including both Java and native stack information.\n\nReport problems\n---------------\n\nIf you run into any issues that aren't due to app JNI issues, report\nthem through the [Android Open Source\nProject Issue Tracker](/docs/setup/contribute/report-bugs#platform). Include an `adb bugreport` and link to\nthe app in Google Play store if available. Otherwise, if possible, attach an\nAPK that reproduces the issue.\n| **Reminder:** Issues (including attachments) are publicly visible."]]