I’m trying to build an automatic import tool using Editor Utility Widget to import a large number of resources, but the memory used by imported resources is never freed by the garbage collection, even though the resources have been saved and are not referenced, and eventually the project will crashes due to out of memory, it makes me have to keep restarting the project to clear the memory used by imported resource, is there any way to free the memory used by importing resources?
Hello Take a look at this Unloading Assets to Free RAM? - Platform & Builds - Unreal Engine Forums
Thanks for reply! These solutions appear to be used at runtime, I am trying to find the solution in the editor mode, and I also found that once loaded some resources in editor mode, the memory they use will never be freed, even if you open an empty level and save everything.
I guess this is an optimization built into the engine, for save time by not having to spend time loading resources every time, but it really bothers me now
I found a way to reduce memory usage when importing resources:
- Import resources
- Save assets
- Copy assets file to a other path
- Delete assets in the project
- Move assets in another path back to the project
- Divide your resources into groups and repeat the steps above
In this way, you can “trick” the engine into thinking that the resource has been deleted and free the memory, and the memory usage will rise very slowly during import, I have just successfully imported 121GB resources into my project through this way in 5 hours.
It’s a bit of a complex way to address this requirement, but it does solve my problem for a while, I hope to find a simpler way to solve this problem