小米12s 12g内存在使用opengl模式,内存跑到3G就崩溃

[Image Removed]

9-19 14:08:54.345 W/Adreno-GSL(17028): <sharedmem_gpuobj_alloc:3197>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

09-19 14:08:54.345 E/Adreno-GSL(17028): <gsl_memory_alloc_pure:2955>: ERROR: kgsl_sharedmem_alloc() failed! Allocation size: (128 KB); Flags: (0xc100300)

09-19 14:08:54.346 W/Adreno-GSL(17028): <sharedmem_gpuobj_alloc:3197>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

09-19 14:08:54.346 E/Adreno-GSL(17028): <gsl_memory_alloc_pure:2955>: ERROR: kgsl_sharedmem_alloc() failed! Allocation size: (128 KB); Flags: (0xc100300)

09-19 14:08:54.346 W/Adreno-GSL(17028): <sharedmem_gpuobj_alloc:3197>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

09-19 14:08:54.347 E/Adreno-GSL(17028): <gsl_memory_alloc_pure:2955>: ERROR: kgsl_sharedmem_alloc() failed! Allocation size: (128 KB); Flags: (0xc100300)

09-19 14:08:54.352 W/Adreno-GSL(17028): <sharedmem_gpuobj_alloc:3197>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

09-19 14:08:54.352 E/Adreno-GSL(17028): <gsl_memory_alloc_pure:2955>: ERROR: kgsl_sharedmem_alloc() failed! Allocation size: (128 KB); Flags: (0xc100300)

09-19 14:08:54.353 W/Adreno-GSL(17028): <sharedmem_gpuobj_alloc:3197>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

09-19 14:08:54.353 E/Adreno-GSL(17028): <gsl_memory_alloc_pure:2955>: ERROR: kgsl_sharedmem_alloc() failed! Allocation size: (128 KB); Flags: (0xc100300)

09-19 14:08:54.353 D/UE (17028): Fatal error: [File:Runtime/OpenGLDrv/Public/OpenGLResources.h] [Line: 299]

09-19 14:08:54.353 D/UE (17028): Failed to lock buffer: Resource 46996, Size 65536, Offset 0, bReadOnly 0, bUseMapBuffer 1, glError (0x502)

09-19 14:08:54.353 D/UE (17028): [2025.09.19-14.08.54:353][913]Fatal error: [File:Runtime/OpenGLDrv/Public/OpenGLResources.h] [Line: 299]

09-19 14:08:54.353 D/UE (17028): Failed to lock buffer: Resource 46996, Size 65536, Offset 0, bReadOnly 0, bUseMapBuffer 1, glError (0x502)

09-19 14:08:54.353 D/UE (17028):

09-19 14:08:54.353 D/UE (17028):

09-19 14:08:54.353 D/UE (17028): [2025.09.19-14.08.54:353][913]LogAndroid: Error: === Critical error: ===

09-19 14:08:54.353 D/UE (17028): [2025.09.19-14.08.54:353][913]LogAndroid: Error:

09-19 14:08:54.353 D/UE (17028): [2025.09.19-14.08.54:353][913]LogAndroid: Error: Fatal error: [File:Runtime/OpenGLDrv/Public/OpenGLResources.h] [Line: 299]

09-19 14:08:54.353 D/UE (17028): [2025.09.19-14.08.54:353][913]LogAndroid: Error: Failed to lock buffer: Resource 46996, Size 65536, Offset 0, bReadOnly 0, bUseMapBuffer 1, glError (0x502)

09-19 14:08:54.353 D/UE (17028): [2025.09.19-14.08.54:353][913]LogAndroid: Error:

09-19 14:08:54.353 D/UE (17028): [2025.09.19-14.08.54:353][913]LogAndroid: Error:

09-19 14:08:54.353 D/UE (17028): [2025.09.19-14.08.54:353][913]LogAndroid: Error:

09-19 14:08:54.367 E/[CrashSightReport-Native](17028): fail to mmap [/data/user/0/com.socgame.projectz/app_crashSight/mmkvlite_log_unwind_1758262076800.mmkv], Out of memory

09-19 14:08:54.367 I/[CrashSightReport-Native](17028): mmkvlite writer file: /data/user/0/com.socgame.projectz/app_crashSight/mmkvlite_log_unwind_1758262076800.mmkv

重现步骤
小米12s 骁龙8Gen1,12g内存的设备在使用opengl模式,加载场景,内存跑到3G就崩溃,vulkan下不会崩溃。

提示09-19 14:08:54.353 W/Adreno-GSL(17028): <sharedmem_gpuobj_alloc:3197>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

09-19 14:08:54.353 E/Adreno-GSL(17028): <gsl_memory_alloc_pure:2955>: ERROR: kgsl_sharedmem_alloc() failed! Allocation size: (128 KB); Flags: (0xc100300)

但是Google Pixel 8只有8g内存,用opengl却不会出现崩溃情况,请问这种问题怎样排查?android 8和12g的设备使用 opengl内存一般控制在多大合适?

我们还发现OpenGL的VB显存比Vulkan要高出一倍以上

Vulkan:

0.045MB - StaticMesh VxColor Inst Mem - STAT_InstVertexColorMemory - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

157.132MB - StaticMesh Index Memory - STAT_StaticMeshIndexMemory - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

1.372MB - StaticMesh VxColor Resource Mem - STAT_ResourceVertexColorMemory - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

198.306MB - StaticMesh Vertex Memory - STAT_StaticMeshVertexMemory - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

374.960MB - StaticMesh Total Memory - STAT_StaticMeshTotalMemory2 - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

271.167MB - Vertex Buffer Memory - STAT_VertexBufferMemory - STATGROUP_RHI - STATCAT_Advanced

151.908MB - Index Buffer Memory - STAT_IndexBufferMemory - STATGROUP_RHI - STATCAT_Advanced

OpenGL

0.045MB - StaticMesh VxColor Inst Mem - STAT_InstVertexColorMemory - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

157.130MB - StaticMesh Index Memory - STAT_StaticMeshIndexMemory - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

1.372MB - StaticMesh VxColor Resource Mem - STAT_ResourceVertexColorMemory - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

198.303MB - StaticMesh Vertex Memory - STAT_StaticMeshVertexMemory - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

374.948MB - StaticMesh Total Memory - STAT_StaticMeshTotalMemory2 - STATGROUP_MemoryStaticMesh - STATCAT_Advanced

748.703MB - Vertex Buffer Memory - STAT_VertexBufferMemory - STATGROUP_RHI - STATCAT_Advanced

179.430MB - Index Buffer Memory - STAT_IndexBufferMemory - STATGROUP_RHI - STATCAT_Advanced

Hello Qi Song,

There was a bug tracking GLES buffer memory in 5.3 which was resolved at CLs 40445732 and 40448156. This likely explains the large differences between GLES and VK, however, if the problem persists after integration, please let us know.

Best regards.

Hi Qi,

Glad to hear the CLs resolved the LLM tracking of GLES buffer memory. As gar as running out of memory, 2.7GB is quite high usage? Is you map very large? You could consider adjust TextureGroup settings to cap out certain overly high resolutions. Is the build targetting ASTC or another compressed format?

Best regards

Hi Qi,

Vulkan and OpenGL have different memory models and this behaviour and memory limits would be device/driver dependent. Given the variety of devices running either of the two APIs, there can’t be strict guidelines on memory budgets. Typically you would adjust memory usage by leveraging per device profiles in which you could for example, reduce the maximum size of textures specifically to certain device levels. In general, Vulkan is the preferred API and OpenGL ES provides a fallback RHI for older devices that either don’t support Vulkan or have unreliable Vulkan drivers.

Best regards.

Hi Qi,

PSS Total refers to total memory page sizes used by the process, whereas the 2.9GB limit referred to earlier was specifically to GLES driver allocations.

Best regards.

Hi Qi Song,

I am not seeing any reference to StaticMesh -> bNeverStream in the 5.3.2 released code. Can you confirm where you are seeing this?

Best regards.

Hi Qi Song,

My apologies for not catching that. To answer your latter question, r.MestStreaming was supported in 5.3.2.

Best regards.

多谢,我集成了 CLs 40445732 and 40448156之后,GLES和VK的区别不大了。

请问小米12s,meizu17等设备跑opengl是在2.7G的时候就会出现崩溃,这个问题有什么解决办法吗?

09-26 11:49:05.835 W/Adreno-GSL(26080): <sharedmem_gpuobj_alloc:2708>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

09-26 11:49:05.835 E/Adreno-GSL(26080): <gsl_memory_alloc_pure:2354>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.

09-26 11:49:05.836 W/Adreno-GSL(26080): <sharedmem_gpuobj_alloc:2708>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory

09-26 11:49:05.836 E/Adreno-GSL(26080): <gsl_memory_alloc_pure:2354>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.

09-26 11:49:05.836 D/UE (26080): [2025.09.26-11.49.05:836][696]LogRHI: Error: Failed to link program. Current total programs: 3490 program binary bytes, last gl error 0x0, drvalloc 99575473

09-26 11:49:05.836 D/UE (26080): log:

09-26 11:49:05.836 D/UE (26080): No log

09-26 11:49:05.836 D/UE (26080): Fatal error: [File:./Runtime/OpenGLDrv/Private/OpenGLShaders.cpp] [Line: 3628]

09-26 11:49:05.836 D/UE (26080): CompleteLoadedGLProgramRequest_internal : Failed to create GL program from binary data! [Program V_C2A81DD0BCEB9121F8DCE271F2AA6515EDCB824D_P_F23814ACDD702233A91E46666C61BC1215432444]

09-26 11:49:05.836 D/UE (26080): [2025.09.26-11.49.05:836][696]Fatal error: [File:./Runtime/OpenGLDrv/Private/OpenGLShaders.cpp] [Line: 3628]

09-26 11:49:05.836 D/UE (26080): CompleteLoadedGLProgramRequest_internal : Failed to create GL program from binary data! [Program V_C2A81DD0BCEB9121F8DCE271F2AA6515EDCB824D_P_F23814ACDD702233A91E46666C61BC1215432444]

09-26 11:49:05.836 D/UE (26080):

09-26 11:49:05.836 D/UE (26080):

09-26 11:49:05.836 D/UE (26080): [2025.09.26-11.49.05:836][696]LogAndroid: Error: === Critical error: ===

09-26 11:49:05.836 D/UE (26080): [2025.09.26-11.49.05:836][696]LogAndroid: Error:

09-26 11:49:05.836 D/UE (26080): [2025.09.26-11.49.05:836][696]LogAndroid: Error: Fatal error: [File:./Runtime/OpenGLDrv/Private/OpenGLShaders.cpp] [Line: 3628]

09-26 11:49:05.836 D/UE (26080): [2025.09.26-11.49.05:836][696]LogAndroid: Error: CompleteLoadedGLProgramRequest_internal : Failed to create GL program from binary data! [Program V_C2A81DD0BCEB9121F8DCE271F2AA6515EDCB824D_P_F23814ACDD702233A91E46666C61BC1215432444]

09-26 11:49:05.836 D/UE (26080): [2025.09.26-11.49.05:836][696]LogAndroid: Error:

09-26 11:49:05.836 I/chatty (26080): uid=10804(com.socgame.projectz) identical 1 line

09-26 11:49:05.836 D/UE (26080): [2025.09.26-11.49.05:836][696]LogAndroid: Error:

是的,我们的地图是5k*3k的大地图,打包用的是ASTC格式,但是同一台手机用vulkan即使跑到了4G也照常运行,没有出现提示内存不足的情况,而opengl只有2.7G就崩溃了,请问这是为什么呢?跑OpenGL内存控制在多少以内是合理的范围?

我还有个比较困惑的地方,我在小米12s机器上尝试对比了一下 鸣潮,我发现它用的UE4.26​引擎,opengl,PSS跑到2.9G也是正常的

[Image Removed]而我们使用的UE5.3.2,PSS加载到2.5-2.7G时就出现了out of memory,请问这两个引擎版本之间有可能会有什么改动导致这种情况发生吗?​

[Image Removed]​

经过测试,我发现在小米12s手机上,OPENGL是由于GFX DEV的值超过500M导致的OOM,我们场景中HLOD过大,Vertex Buffer和Index Buffer占用了近300M的GFX DEV内存。

我看UE5.3.2代码中,默认StaticMesh的bNeverStream是true,默认是关闭状态的。

请问Android上能够支持开启MeshStreaming吗?如果能开启会不会出现兼容问题?请问需要设置哪些相关参数开启?

不好意思,我说错了,不是bNeverStream, 是NeverStream这个值,它默认是false,支持Streaming,请问是将r.MeshStreaming这个指令设置为true就能开启MeshStreaming了吗?

[Image Removed]

明白了,多谢