Hey so, I’ve been developing a first person walkaround game in Unreal Engine for a few months now, and its been going pretty smooth. But just a few days ago, a strange bug began appearing.
Basically, how it works is as follows:
-Open game in PIE or standalone game
-Game runs normally for about a minute or two
-I start experiencing subtle freezes that progressively get worse
-Project crashes; returns error
The error: Fatal error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\Containers\ContainerHelpers.cpp] [Line: 8]
Trying to resize TArray to an invalid size of 2147483648
I’ve attached the link to a video demonstrating the bug, as well as a picture of the crash report. Any help is greatly appreciated and welcome!
Checking through your video, and the error you are getting, that looks like an array growing out of control. Since it doesn’t happen right away, something in the project is piling up on every tick, until it snowballs into a crash.
Checking with my peers, the most likely cultrip is the garbage collector, or something spawning in your scene without control.
Clear the array from time to time, and check against any duplicates in your code. The best way to pinpoint the guilty element would be to check the full crash callstack, and look for the last function accessed, besides any regular engine code.
If it’s a spawn loop problem, add more cleanup, or check what exactly is being spawned. You can also run with “stat memory” or “stat obj list” in PIE. If you see thousands of one actor type building up, that should be the cause.