I have submitted a bug report for this, but I want to share it here as well in case anyone else has ever encountered this issue.
In a nutshell, when saving large projects, the shared GPU memory on my computer will fill up to max. Once this happens, UE will crash, either with a reportable “memory access violation” error, or an unreportable “out of video memory trying to allocate a rendering resource” error (with just an ok button).
Specifics: This has been happening back with UE4, and it’s still present in UE5. It occurs after saving a lot of data, especially when source control (svn) is enabled. While saving or syncing to source control, a message “updating file(s) source control status…” appears among others. While this is happening, UE cannot be interacted with (I think this has also occurred outside of a project with version control, but I’ve encountered it primarily working with svn source control). Furthermore, the RAM usage seen in task manager increases- previously I had 32 GB RAM and it would fill to the page file. In addition, shared GPU memory would also fill up. Windows appears to allocate half the RAM to shared VRAM on my system (with an RTX 2070). I recently upgraded to 48 GB expecting that would fix the issue. Going from 32 to 48 GB RAM increased my shared VRAM from 16 to 24 GB. Previously, UE would crash with near 100% RAM consumption (for the whole system) and 100% shared VRAM consumption, however now it crashes at about 75% RAM consumption, with shared VRAM still reaching 100%. Upon maxing out, either the normal UE crash window appears where I can describe and submit a report, or an “out of memory” window appears with an ok button and no error codes. Sometimes dwm.exe takes up VRAM due to windows memory leaks with this program, and restarting this might free enough shared VRAM for UE to not crash. Upon closing out of the error message, the engine closes (or restarts if I clicked “send and restart”), freeing all shared VRAM and normal RAM. If the normal crash window appears, the top faulting dll is displayed, usually a dll related to the graphics drivers (d3d12 and similar; if I see this window again I will mention which dll specifically). No errors in windows event viewer are reported, but if anyone potentially knows where relevant crash logs could be found, that would be helpful. I am running Windows 10 with the latest updates (not win11), I have manually set up at least 16 GB in page files on nvme storage, and my cpu is a Ryzen 3700x on the b550(m) chipset.
Now for some theories- I also have tortiseSVN installed to sync files in case UE fails to do so. Whenever I use tortise, RAM never fills up and shared VRAM is untouched. I may have to stick to using only tortise with my projects, rather than using UE’s own tools. I saw somewhere that a dev said that UE does not perform garbage collection (at least unless needed), and if this is true then it’s likely the issue- while saving, UE is trying to load all the files that need to be uploaded or saved into RAM, and then all at once sends or saves them, and then unloads them all at once once done. This is an inefficient and problem prone method of saving, as it’s relying on massive amounts of RAM on the system to work. Saving could be performed easier and with less reliance on RAM by loading, saving/sending, and unloading files one at a time from the disk, or otherwise by reducing the total data getting stored onto RAM just to save, an operation that I don’t really care about how long it takes if I’m saving large files or many files (especially if autosaving is functioning, then my big save likely was incrementally saved in autosave before so if something else goes wrong then I can restore with less loss). This issue is especially important because of UE5’s “one file per asset” structure for maps, where now there’s tons of files to save even if I just reorganize assets on my map in the world outliner with folders.
If anyone has encountered this, I would like to know as I haven’t seen a lot of mention of anything like this before. If there’s any settings in UE or with my PC that might help that would also be helpful. In the meantime, I have disabled svn in UE5 for one of my projects which has shown this issue (using tortisesvn entirely), and I will update if doing so has alleviated the issue entirely.