1. Error Messages:
E/EGL_adreno: tid 3927: eglSurfaceAttrib(1334): error 0x3009 (EGL_BAD_MATCH)
java.lang.OutOfMemoryError: Failed to allocate a 146313228 byte allocation with 16777216 free bytes and 115MB until OOM
2. Reason
Description: The memory of our Android project is overflowing, my guess is that the reason may be the difference in resolution leading to memory overflow of the project content or too much content to load (images and other resources)
Especially controls that load a lot of data in a list have custom images.
3. Solution
Original Codes
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.MyFourth" > <activity android:name=".MainActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <service android:name=".service.MusicService"/> </application>
Add the following codes after <application
:
android:largeHeap="true" android:hardwareAccelerated="false"
Full Modified Codes
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.MyFourth" android:largeHeap="true" android:hardwareAccelerated="false" > <activity android:name=".MainActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <service android:name=".service.MusicService"/> </application>
android:hardwareAccelerated="true"
An application that uses largeHeap will request the system to allocate more memory space for the Dalvik virtual machine. It is also easy to use, just add android:largeHeap=”true” to the application node of the manifest file.
android:hardwareAccelerated="false"
The default is true which will start hardware acceleration but will, however, take up memory
Read More:
- Remember an android app startup error Error running: Default Activity not found
- [Solved] Android12 Download Error: The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
- [Solved] Error in inherits(x, “theme”): argument “e2” is missing, with no default
- Android Error: Consumer closed input channel or an error occurred. events=0x9
- [Solved] Git error: bad signature 0x00000000 fatal: index file corrupt
- No match for ‘operator =’ both ends of the equal sign do not match
- [Solved] OpenGL PowerVR SDK Compiling Error: Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
- [Solved] Could not identify launch activity: Default Activity not found Error while Launching activity
- [Solved] Android 9.0 APP Install Android 4.4 Error: IllegalArgumentException
- Android studio configurate intent-filter and compile error [Solved]
- [Solved] Manifest merger failed: Apps targeting Android 12 and higher are required to specify an explicit
- [Solved] Android x relies on AAR errors: Failed to transform…
- Keil’s duplicate definition problem: Error: L6200E: Symbol F6x8 multiply defined
- [Solved] Rocketmq console connect to x.x.x.x:10911 failed Error
- Android 10 SurfaceView Crash: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
- [Solved] Android Studio Run Error: Error while executing: am start -n
- [Solved] Leetcode Error: AddressSanitizer: SEGV on unknown address 0x55eb765425b8 (pc 0x55eb76542b86 bp 0x7ffd1bd2
- Flash back problem when Android studio plays music in sdcard through intent