../jvm-and-art

JVM and ART

Table of contents

Java Virtual Machine (JVM).

Dalvik → Android Runtime (ART).

The structure of JVM.
The structure of JVM.
GC in JVM, vs GC in ART.
GC in JVM, vs GC in ART.

Garbage Collection

How it works? What optimizations? What impacts on performance? Tools for analysis?

Concepts in JVM (Hotspot implementation)Concepts in Android VM (ART)
generational GC heap, ie young, old, and permanentgenerational GC heap, ie young and old
concurrent copying (improving GC, reducing background memory usage & fragmentation, see Linux Memory Management)
read barrier (improvement in GC implementation detail)
Reference: Android 8.0 ART improvements, https://source.android.com/docs/core/runtime/improvements

Typical process on heap:

Allocation for objects → generational GC triggered → reclaim unused allocation.

Reference: JVM垃圾回收详解Java内存区域详解类加载过程

Reference: JVM Specification (SE22) - Chapter 5 Loading, Linking, and Initializing

Reference: Overview of Memory Management, developer.android

Memory Management

Reference: Manage your app’s memory, developer.android.

Reference: 内存管理(Linux)操作系统常见面试题总结-内存管理JMM(Java内存模型)详解

🫑 Some memory-efficient code suggestions, from developer.android.

/note/ /Android/ /JVM/ /ART/ /GC/ /Memory/