Memory Optimization Articles

Why Bitmap Causes OOM on Android: A Practical Guide to Image Memory

Explains Bitmap memory usage, Java heap vs. native heap, Hardware Bitmap, sampling, compression, and image loading optimization.

Android On-device AI Memory Management: Model Loading Peaks, Tensor Lifetimes, and KV Cache Reclaim

A practical memory-management path for Android on-device LLM deployment, covering mmap model loading, tensor lifecycle reclamation, sliding-window KV cache, layer-wise decay, and LMK survival.

Android Bitmap Memory Model: From Java Heap to Hardware Bitmap

A deep dive into how Android Bitmap pixel storage moved between native heap, Java heap, and GPU memory, and what that means for OOM prevention.

Kotlin Value Classes and Inline Classes: Zero-Overhead Type Safety

A deep dive into Kotlin inline class and value class compilation, boxing elimination, JVM signatures, Android performance patterns, and serialization compatibility.

Android On-device AI Memory Bandwidth: GPU Shared Memory to NPU Zero-copy

A practical guide to Android on-device AI memory-bandwidth optimization, from camera-to-GPU data movement to AHardwareBuffer, ION reuse, and NPU zero-copy paths.