android · android/OutOfMemoryError
OutOfMemoryError
OutOfMemoryError
Thrown by the Android Runtime when the heap is exhausted. The most common cause is retaining large Bitmap objects or off-screen Views. Use Glide or Coil for image loading (they handle sampling and caching), avoid static references to Context or View, and use LeakCanary to detect leaks.
Also defined in
- dart OutOfMemoryError Thrown when the Dart VM cannot allocate enough memory to complete an operation.
- java OutOfMemoryError Thrown when the JVM cannot allocate memory because the heap is exhausted. Increase -Xmx, fix a memory leak, or reduce allocation pressure.
- julia Out of Memory The Julia runtime could not allocate the requested amount of memory. This can be caused by allocating very large arrays, memory leaks, or insufficient system RAM. Profile with @allocated or reduce the size of intermediate arrays.
- kotlin OutOfMemoryError Thrown by the JVM when the heap cannot satisfy an allocation request. Often indicates a memory leak or an unexpectedly large data structure.
- scala OutOfMemoryError Thrown when the JVM cannot allocate more memory in the heap. Causes include very large collections, accumulated objects without garbage collection, or an insufficient -Xmx setting.