Programming/Android
java.lang.OutOfMemoryError: Failed to allocate a ? byte allocation with ? free bytes and ?MB until OOM
생각하는로뎅
2017. 1. 20. 02:57
반응형
1. 비트맵을 처리하는 동안 가장 일반적인 문제는 안드로이드에서 발생하며, 메모리 공간 부족으로 인해 객체를 할당 할 수 없고, 가비지 컬렉터가 일부 공간을 비울 수 없는 경우 에러가 발생한다.
java.lang.OutOfMemoryError: Failed to allocate a ? byte allocation with 2097152 free bytes and ?MB until OOM
2. 매니피페스트에 아래와 같이 추가하면, 임시로 해결은 할 수 있다.
android:largeHeap="true" 을 추가해준다.
<application
android:allowBackup="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
3. 근본적인 원인을 찾아서 해결하는것이 중요하다.
반응형