During the use of my Unity application, a crash occurred. After inspecting the logs, I found that Unity was attempting to allocate a ridiculously large amount of memory, which resulted in the crash. I tried to replicate the issue using the user’s method but was not successful in reproducing it. My Unity version is 2022.3.8f1c1.
I’ve been troubled by this issue for almost a week and hope someone can help me.
The error log is as follows:
Could not allocate memory: System out of memory!
Trying to allocate: 18446744056529682440B with 16 alignment. MemoryLabel: TempOverflow
Allocation happened at: Line:69 in C:\jenkins\sharedspace\ra_2022.3\Runtime\Utilities\dynamic_array.h
Memory overview
[ ALLOC_TEMP_TLS ] used: 21912B | peak: 0B | reserved: 9633792B
[ ALLOC_MEMORYPROFILER ] used: 809680B | peak: 809680B | reserved: 1048576B
[ ALLOC_DEFAULT ] used: 158411296B | peak: 0B | reserved: 170221568B
[ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 0B
[ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 0B
[ ALLOC_TEMP_JOB_4_FRAMES (JobTemp) ] used: 599914B | peak: 0B | reserved: 4194304B
[ ALLOC_TEMP_JOB_ASYNC (Background) ] used: 237B | peak: 0B | reserved: 6291456B
[ ALLOC_GFX ] used: 9834152B | peak: 0B | reserved: 33554432B
[ ALLOC_CACHEOBJECTS ] used: 40457036B | peak: 0B | reserved: 46063616B
[ ALLOC_TYPETREE ] used: 12928B | peak: 0B | reserved: 4194304B
[ ALLOC_PROFILER ] used: 445640B | peak: 34932280B | reserved: 50331648B
Could not allocate memory: System out of memory!
Trying to allocate: 18446744056529682440B with 16 alignment. MemoryLabel: TempOverflow
Allocation happened at: Line:69 in C:\jenkins\sharedspace\ra_2022.3\Runtime\Utilities\dynamic_array.h
Memory overview
[ ALLOC_TEMP_TLS ] used: 21912B | peak: 0B | reserved: 9633792B
[ ALLOC_MEMORYPROFILER ] used: 809680B | peak: 809680B | reserved: 1048576B
[ ALLOC_DEFAULT ] used: 158411296B | peak: 0B | reserved: 170221568B
[ ALLOC_TEMP_JOB_1_FRAME ] used: 0B | peak: 0B | reserved: 0B
[ ALLOC_TEMP_JOB_2_FRAMES ] used: 0B | peak: 0B | reserved: 0B
[ ALLOC_TEMP_JOB_4_FRAMES (JobTemp) ] used: 599914B | peak: 0B | reserved: 4194304B
[ ALLOC_TEMP_JOB_ASYNC (Background) ] used: 237B | peak: 0B | reserved: 6291456B
[ ALLOC_GFX ] used: 9834152B | peak: 0B | reserved: 33554432B
[ ALLOC_CACHEOBJECTS ] used: 40457036B | peak: 0B | reserved: 46063616B
[ ALLOC_TYPETREE ] used: 12928B | peak: 0B | reserved: 4194304B
[ ALLOC_PROFILER ] used: 445640B | peak: 34932280B | reserved: 50331648B
The stack trace information at the time of the crash is as follows:
========== OUTPUTTING STACK TRACE ==================
0x00007FF8FCD25B93 (UnityPlayer) DebugStringToFilePostprocessedStacktrace
0x00007FF8FCD2538E (UnityPlayer) DebugStringToFile
0x00007FF8FB571717 (UnityPlayer) MemoryManager::Allocate
0x00007FF8FB5712BE (UnityPlayer) MemoryManager::Allocate
0x00007FF8FB5712BE (UnityPlayer) MemoryManager::Allocate
0x00007FF8FB57A020 (UnityPlayer) malloc_internal
0x00007FF8FBE82D06 (UnityPlayer) dynamic_array_detail::dynamic_array_data::reserve
0x00007FF8FC86873C (UnityPlayer) UI:: DepthSortGrid::AddAndGetDepthFor
0x00007FF8FC86AF68 (UnityPlayer) UI:: PrepareDepthEntries
0x00007FF8FC86BC6C (UnityPlayer) UI::SortForBatching
0x00007FF8FC86BF7E (UnityPlayer) UI::SortForBatchingJob
0x00007FF8FBA96967 (UnityPlayer) ujob_execute_job
0x00007FF8FBA960E4 (UnityPlayer) lane_guts
0x00007FF8FBA987E4 (UnityPlayer) worker_thread_routine
0x00007FF8FBF0BE97 (UnityPlayer) Thread::RunThreadWrapper
0x00007FF93DCE7344 (KERNEL32) BaseThreadInitThunk
0x00007FF93F7026B1 (ntdll) RtlUserThreadStart
========== END OF STACKTRACE ===========