Memory related crash when importing .fbx meshes

I want to import ~1000 .fbx meshes that contain around 1million polygons each. Therefore i have following script:

After around 20 imported meshes, unreal engine crashes although I have 32GB of Ram. When I import a single mesh, unreal Engine does not crash, but memory usage goes up. When I restart Unreal engine with the imported meshes, memory usage is normal again. So my assumption is that ram is not freed after a successful import. Am I missing something in my import script to free up memory after each mesh import?

You probably are running out of memory, because assets imported will not be freed up and are kept around; inside the editor once an asset has been loaded it is subsequently unloaded.

How do I free up assets after importing via python?

when you saved the asset call this if its not referenced anymore




unreal.SystemLibrary.collect_garbage()