java.lang.OutOfMemoryError: Failed to allocate a 3110419 byte allocation with 741152 free bytes and
2017-08-09 17:57
716 查看
在进行SurfaceView的开发时,出现了java.lang.OutOfMemoryError错误;
由于项目是同时显示四路远端传输过来的视频
所以采用的方法是使用:android:hardwareAccelerated="false"
android:largeHeap="true"
即关闭硬加速,因为他比较消耗内存,另外开启最大内存。
但并不是所有项目都应该使用这样的方法去解决OutOfMemoryError问题,如果是大图片和视频应用可以使用android:largeHeap="true";
由于项目是同时显示四路远端传输过来的视频
所以采用的方法是使用:android:hardwareAccelerated="false"
android:largeHeap="true"
即关闭硬加速,因为他比较消耗内存,另外开启最大内存。
但并不是所有项目都应该使用这样的方法去解决OutOfMemoryError问题,如果是大图片和视频应用可以使用android:largeHeap="true";
相关文章推荐
- Caused by: java.lang.OutOfMemoryError: Failed to allocate a 29433932 byte allocation with 14683576 free bytes and 14MB
- Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free
- Android:java.lang.OutOfMemoryError: Failed to allocate a 23970828 byte allocation with 2097152 free
- Caused by: java.lang.OutOfMemoryError: Failed to allocate a 38428990 byte allocation with 23734224
- java.lang.OutOfMemoryError: Failed to allocate a 22440958 byte allocation with 16777216 free bytes
- Failed to allocate a 76 byte allocation with 0 free bytes and 0B until OOM
- Failed to allocate a 38189038 byte allocation with 16777216 free bytes and 20MB until OOM
- Failed to allocate a 3112972 byte allocation with 2019776 free bytes and 1972KB until OOM
- Java # java.lang.OutOfMemoryError: requested 32744 bytes for ChunkPool::allocate. Out of swap space?
- OpenCV Error: Insufficient memory (Failed to allocate 47752340 bytes) in cv::OutOfMemoryError, file
- 内存溢出:java.lang.OutOfMemoryError: pthread_create (stack size 131072 bytes) failed: Out of memory
- HBASE遇到的java.lang.OutOfMemoryError: unable to create new native thread解决方法
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- java.lang.OutOfMemoryError: unable to create new native thread
- TcpSocketLink OutOfMemory,java.lang.OutOfMemoryError: unable to create new native thread 问题解决过程小记
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- How to fix the dreaded "java.lang.OutOfMemoryError: PermGen space" exception (classloader leaks)
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- 由"java.lang.OutOfMemoryError: unable to create new native thread"说起
- java.lang.OutOfMemoryError: unable to create new native thread