I have a Blender Python script that uses a loop to sequentially load and render viewpoints of multiple OBJ files that I generally try to run from the command line. However, if I have Blender open, eventually it starts using up more and more memory and things will crash for processing a large amount of OBJ files. I've gone through several Stack Overflow answers to figure out how to delete the OBJ files I'm importing as well as the camera settings and such that I set for each viewpoint render, but none of them seem to delete everything. I've tried the following answers:
https://blender.stackexchange.com/a/101319/103462 and https://blender.stackexchange.com/a/27235/103462
However, each time I hit run on my script, the stats under "Current File" keep going up, thus progressively increasing memory usage:
How do I clear out those camera, material, mesh, objects, etc. for each iteration of processing loop?
My code is located here: https://pastebin.com/HDxQKByY