You call memory as bug lol
But at essence it is bad program code.
Memory is when a program allocate memory but not free up after use… that happens because the program logic/code doesn’t do the job correctly.
In the case of a game we can list some causes:
1) The game code is allocating memory but not feeling all of it… that is the developer burden.
2) Developer code is fine but the Engine code is allocating but freeing all… that is a Engine burden… in this case Unreal Engine 5.
3) Both developer and Engine code are fine but the APIs of the platform is not… in the case of Series consoles it is the DirectX API used that can be allocating and not feeing it.
Basically these are the place the issue can be.
Developer code, Engine code or the platform APIs code.
Memory leak allow for all the memory to be used over the time and that will either make the OS start to use Swap (becoming super slow even on SSD) or crash the program.
In any case I don’t call memory leak bug because it just bad programming code… if you keep track of what you are doing and free up the memory used correctly you won’t have memory leak.
PS. Of course this is using a language that compiles to native code like the used in games and not something like Java or .NET… in this case all the free up memory is done by the garbage collection… so the issue will be always on the virtual machine / JIT being good enough to free up the memory it used… and in a lot of cases it doesn’t do a good job.
I still prefer to have the control in my hands so even if it is way more work you doing a code where you free up everything you use in C/C++ will be a better job than using some auto garbage collector… but these new languages doesn’t give option to do it yourself.
Games are made in the old languages so either is developer, Engine or MS platform APIs faulty here.
At the end the source of memory leak needs to be fixed.