Android 18 Beta 1: soft memory limits for background services and a stricter ART runtime
Public- 05 Dec, 2026

Google has released the first beta of Android 18 (API level 38). It is the annual major SDK release and the only one in the cycle that includes planned app-breaking behavior changes, as well as NDK updates. Betas now ship roughly every two weeks, in parallel with the end of the Android 17 QPR3 beta. Platform Stability is targeted for February: by then the SDK/NDK APIs will be final, and app-facing behaviors will be largely final. Several months of testing will follow before release. After launch, Android 18 will continue with quarterly updates, and only the Q2 release includes planned breaking changes.
The headline feature is per-process soft memory limits for processes running a service without visible UI. The limit scales with the service role and the device's RAM. Most mainstream phones still have 4 to 8 GB of RAM, and cached apps are often evicted: foreground services such as syncs, downloads, playback or location updates keep the main UI process pinned at elevated priority, and with it stopped Activity hierarchies, decoded bitmaps and graphics buffers. Android now pages out untouched allocations automatically, and usually no code changes are needed. Background work slows only if the service's own working set exceeds the limit: then page faults begin, because evicted files must be reloaded and swapped pages must be decompressed.
The limits roll out gradually during the beta, so a device running Beta 1 may not have them yet. You can check the state with the following commands: adb shell am memory-limiter status, adb shell dumpsys activity processes <package-name> and adb shell dumpsys meminfo <package-name>. If the meminfo output lacks a Memory Budget section or the "Limit Source: Process role" line, the feature hasn't reached the device yet. You can force a limit with the command adb shell am memory-limiter manual -p <pid> <size>MBand clear it with the parameter none. A manual override sets both soft and hard limits, so going below the current working set can kill the process.
The feature builds on tools from Android 17, 17 QPR1 (SDK 37.1) and 17 QPR2 (SDK 37.2): MemoryBudgetManager with usage and budget queries, setProcessBudgetBytes and an over-budget listener; the exit reasons REASON_MEMORY_LIMITER and REASON_ANOMALY in ApplicationExitInfo; getAnrInfo; the TRIGGER_TYPE_OOM and TRIGGER_TYPE_ANOMALY triggers in ProfilingManager; and androidx.core.os.MemorySnapshot. QPR2 also added NPU memory preemption in LiteRT and AICore, freezing of idle NotificationListenerService, and memory-safe FLAC and MP3 decoders. All of this helps prepare for the Android Vitals thresholds that Google Play will introduce in February 2027, covering memory, bitmap usage and DEX optimization.
ART now enables time-based garbage collection by default, which first shipped on Pixel in Android 17. Instead of static allocation watermarks controlled by seven interdependent heap properties, it adapts GC cadence to allocation rate and time since the last collection, and once an app goes idle, it concurrently reclaims the unused part of the heap. The lock-free MessageQueue, introduced in Android 17 for apps targeting API 37 and higher, now applies to all apps, and the legacy locked version has been removed. Earlier traces showed main-thread lock contention down 15%, 4% fewer missed frames, and p95 startup to first frame 9.1% faster. Reflection on private fields like mMessages now returns null: watchdogs should move to Looper logging or ProfilingManager, and Espresso and Robolectric should be updated.
In addition, ART enforces OpenJDK 17 sealed class and interface rules at load time, rejecting violations with VerifyError, and SDK jars are built for Java 17. If sealed hierarchies change, modules should be recompiled together. Subclasses generated at runtime are also affected, for example Mockito mocks in instrumented tests. Apps targeting Android 18 can no longer synchronize on instances of value-based classes: errors like "java.lang.Integer is not an identity class" signal this. If you run dex2oat on the release APK in an adb shell, the log will show "monitor-enter on value-class" warnings. Such locks should be replaced with objects that are not value-based classes.